LanguageService.GetColorableItem Method (Int32, IVsColorableItem)

 

Returns the requested IVsColorableItem object.

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

public virtual int GetColorableItem(
	int index,
	out IVsColorableItem item
)

Parameters

index
Type: System.Int32

[in] A zero-based index into the list of colorable items maintained by the language service.

item
Type: Microsoft.VisualStudio.TextManager.Interop.IVsColorableItem

[out] Returns the IVsColorableItem object.

Return Value

Type: System.Int32

If successful, returns S_OK; otherwise, returns an error code.

If your language service supports custom colorable items, you must derive a class from the LanguageService class and implement this method as well as GetItemCount. Note that this method is never called with an index of 0 since that index represents the default text format set by the user. You should return an error if the index is outside the range of your list.

In the Managed Package Framework, a custom colorable item is represented by the ColorableItem class, which implements the IVsColorableItem interface.

The base method always returns E_NOTIMPL indicating the method is not implemented.

Return to top
Show: