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 (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'Déclaration
Public Overridable Function GetColorableItem ( _
index As Integer, _
<OutAttribute> ByRef item As IVsColorableItem _
) As Integer
'Utilisation
Dim instance As LanguageService
Dim index As Integer
Dim item As IVsColorableItem
Dim returnValue As Integer
returnValue = instance.GetColorableItem(index, _
item)
public virtual int GetColorableItem(
int index,
out IVsColorableItem item
)
public:
virtual int GetColorableItem(
int index,
[OutAttribute] IVsColorableItem^% item
)
abstract GetColorableItem :
index:int *
item:IVsColorableItem byref -> int
override GetColorableItem :
index:int *
item:IVsColorableItem byref -> int
public function GetColorableItem(
index : int,
item : IVsColorableItem
) : int
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%)
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.