Over 10 Million Study Resources Now at Your Fingertips

Download as :
Rating : ⭐⭐⭐⭐⭐
Price : $10.99
Pages: 2

Here you also store the maximum length registered extensions

Extending the New Editor ❘273

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.


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

How It Works
Login account
Login Your Account
Add to cart
Add to Cart
Make payment
Document download
Download File
PageId: ELI2874222
Uploaded by :
Page 1 Preview
here you also store the maximum length registered
Sell Your Old Documents & Earn Wallet Balance