Partager via


IVsFontAndColorStorage.SetItem Method

Stores the user-modifiable color and font settings for a named Display Item in the registry.

Namespace:  Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

Syntax

'Déclaration
Function SetItem ( _
    szName As String, _
    pInfo As ColorableItemInfo() _
) As Integer
'Utilisation
Dim instance As IVsFontAndColorStorage
Dim szName As String
Dim pInfo As ColorableItemInfo()
Dim returnValue As Integer

returnValue = instance.SetItem(szName, _
    pInfo)
int SetItem(
    string szName,
    ColorableItemInfo[] pInfo
)
int SetItem(
    [InAttribute] String^ szName, 
    [InAttribute] array<ColorableItemInfo>^ pInfo
)
abstract SetItem : 
        szName:string * 
        pInfo:ColorableItemInfo[] -> int 
function SetItem(
    szName : String, 
    pInfo : ColorableItemInfo[]
) : int

Parameters

  • szName
    Type: System.String
    [in] Null-terminated string containing the non-localized name of the Display Item.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsFontAndColorStorage::SetItem(
   [in] LPCOLESTR szName,
   [in] ColorableItemInfo *pInfo
);

If a call to IVSFontAndColorStorage::SetItem succeeds, and the item's Category was opened by OpenCategory with a mode of FCSF_PROPAGATECHANGES, the method generates an event to be handled by OnItemChanged. If the item's Category was not opened with FCSF_PROPAGATECHANGES, applications must query the environment to obtain this information using GetItem GetItemByName or GetItem.

It is up to applications rendering text to the Visual Studio environment to update their display to match the settings modified by this method.

.NET Framework Security

See Also

Reference

IVsFontAndColorStorage Interface

IVsFontAndColorStorage Members

Microsoft.VisualStudio.Shell.Interop Namespace

IVsFontAndColorStorage2