Language:EN
Pages: 2
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
here you also store the maximum length registered

Here you also store the maximum length registered extensions

Extending the New Editor ❘273

}
else
{
var classificationType = _fileAssociations[keyFound].StartsWith(“text”) ? _textClassification
: _nonTextClassification;
int wordLength = keyFound.Length;
classifications.Add(new ClassificationSpan(
new SnapshotSpan(span.Snapshot,
new Span(wordStart + span.Start, wordLength)), classificationType)); searchOffset = wordStart + wordLength;
}
}
while (true);
return classifications;
}
}
}

There are many ways to do that. The algorithm used here seems a bit complicated; you may create a simpler solution. However, there are two important things to be keep in mind when programming the GetClassificationSpan method:

➤ The text spans returned must be ordered by their starting position and non - overlapping, in order to be displayed correctly in the editor.

274❘CHAPTER 6VISUAL STUDIO EXTENSIBILITY

Run the extension with Debug ➪ Start Without Debugging, and create a new text fi le. Type some text containing fi le extensions, using both text and non - text types. Figure 6 - 38 shows how the classifi er works.

FIGURE 6 - 39: Text Content format is customizable

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Gavin Davies-Nash

PageId: ELI2874222