Colorizer Class

 

This class implements the IVsColorizer interface and is used to support syntax highlighting in an editor.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

System.Object
  Microsoft.VisualStudio.Package.Colorizer

[CLSCompliantAttribute(false)]
[ComVisibleAttribute(true)]
public class Colorizer : IVsColorizer, IDisposable

NameDescription
System_CAPS_pubmethodColorizer(LanguageService, IVsTextLines, IScanner)

Initializes the Colorizer class.

NameDescription
System_CAPS_pubpropertyScanner

Returns the scanner being used.

NameDescription
System_CAPS_pubmethodCloseColorizer()

Called when the colorizer is disposed of.

System_CAPS_pubmethodColorizeLine(Int32, Int32, IntPtr, Int32, UInt32[])

Obtains color and font attribute information for each character in the specified line of text.

System_CAPS_pubmethodDispose()

Disposes the object.

System_CAPS_pubmethodEquals(Object)

(Inherited from Object.)

System_CAPS_protmethodFinalize()

Called when the object is about to be destroyed.(Overrides Object.Finalize().)

System_CAPS_pubmethodGetColorInfo(String, Int32, Int32)

Returns the parsing state at the end of the line without returning any colorization information.

System_CAPS_pubmethodGetHashCode()

(Inherited from Object.)

System_CAPS_pubmethodGetLineInfo(IVsTextLines, Int32, IVsTextColorState)

Returns color information about the specified line.

System_CAPS_pubmethodGetStartState(Int32)

Returns the initial parsing state.

System_CAPS_pubmethodGetStateAtEndOfLine(Int32, Int32, IntPtr, Int32)

Returns the parsing state at the end of the specified line.

System_CAPS_pubmethodGetStateMaintenanceFlag(Int32)

Called to determine if the colorizer requires per line state management.

System_CAPS_pubmethodGetType()

(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethodResume()

Called to resume use of the colorizer.

System_CAPS_pubmethodSuspend()

Called to suspend use of the colorizer.

System_CAPS_pubmethodToString()

(Inherited from Object.)

The managed package framework (MPF) version of this class uses an IScanner object to handle all parsing tasks. The IScanner object communicates color information through the TokenInfo structure. The Colorizer class also helps the IScanner object track state by passing around a state variable the parser maintains.

This class handles colorization on a line by line basis.

Notes to Implementers:

The MPF version of this class performs all the work necessary to colorize a line of code by interacting with the IScanner object. If you find you need additional functionality not supported in the existing Colorizer class, you must derive a class from the Colorizer class and return an instance of your class from GetColorizer.

The default implementation of GetColorizer instantiates the MPF version of Colorizer, passing to the Colorizer constructor an instance of the IScanner object obtained from GetScanner.

Notes to Callers:

The colorizer object returned from GetColorizer is stored in the Source object when the Source object is created. The Source object handles all interactions with the colorizer so there is no need for any outside involvement with the colorizer.

The methods of this class are documented in case you need to implement your own version of the Source class.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: