共用方式為


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.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)

Syntax

'宣告
Public Overridable Function GetColorableItem ( _
    index As Integer, _
    <OutAttribute> ByRef item As IVsColorableItem _
) As Integer
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.

Return Value

Type: System.Int32
If successful, returns S_OK; otherwise, returns an error code.

Implements

IVsProvideColorableItems.GetColorableItem(Int32, IVsColorableItem%)

Remarks

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.

.NET Framework Security

See Also

Reference

LanguageService Class

Microsoft.VisualStudio.Package Namespace