Share via


IVsFontAndColorStorage.SetItem(String, ColorableItemInfo[]) Method

Definition

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

public:
 int SetItem(System::String ^ szName, cli::array <Microsoft::VisualStudio::Shell::Interop::ColorableItemInfo> ^ pInfo);
public:
 int SetItem(Platform::String ^ szName, Platform::Array <Microsoft::VisualStudio::Shell::Interop::ColorableItemInfo> ^ pInfo);
int SetItem(std::wstring const & szName, std::Array <Microsoft::VisualStudio::Shell::Interop::ColorableItemInfo> const & pInfo);
public int SetItem (string szName, Microsoft.VisualStudio.Shell.Interop.ColorableItemInfo[] pInfo);
abstract member SetItem : string * Microsoft.VisualStudio.Shell.Interop.ColorableItemInfo[] -> int
Public Function SetItem (szName As String, pInfo As ColorableItemInfo()) As Integer

Parameters

szName
String

[in] Null-terminated string containing the non-localized name of the Display Item.

pInfo
ColorableItemInfo[]

[in] Reference to a ColorableItemInfo structure containing information about the DisplayItem.

Returns

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 GetItemGetItemByName 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.

Applies to