Export (0) Print
Expand All
Expand Minimize

LanguageService.GetColorableItem Method

Returns the requested IVsColorableItem object.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.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.

Implements

IVsProvideColorableItems.GetColorableItem(Int32, IVsColorableItem)

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.

Show:
© 2014 Microsoft