IVsSettingsWriter.WriteSettingBoolean Method

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Stores the value of a Boolean object in the Visual Studio settings file.

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

Syntax

'宣言
Function WriteSettingBoolean ( _
    pszSettingName As String, _
    fSettingValue As Integer _
) As Integer
'使用
Dim instance As IVsSettingsWriter
Dim pszSettingName As String
Dim fSettingValue As Integer
Dim returnValue As Integer

returnValue = instance.WriteSettingBoolean(pszSettingName, _
    fSettingValue)
int WriteSettingBoolean(
    string pszSettingName,
    int fSettingValue
)
int WriteSettingBoolean(
    [InAttribute] String^ pszSettingName, 
    [InAttribute] int fSettingValue
)
function WriteSettingBoolean(
    pszSettingName : String, 
    fSettingValue : int
) : int

Parameters

  • pszSettingName
    Type: System.String

    [in] String uniquely identifying the data element to be stored.

  • fSettingValue
    Type: System.Int32

    [in] Boolean value to be stored as the specified data element of the Visual Studio settings file.

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 vsshell80.idl:

HRESULT WriteSettingBoolean(
   LPCOLESTR pszSettingName,
   BOOL fSettingValue
);

The names specified by pfSettingValue need to be unique within a Custom Settings Point (settings category), as the IDE uses the Custom Settings Point identifying GUID and the value of pfSettingValue to identify each saved setting.

If more than one IVsSettingsWriter method is called with the same value of pszSettingName, the original value is overwritten in the Visual Studio settings file.

Because the value of pfSettingValue must be unique, the order of calling WriteSettingBoolean with respect to other methods of the IVsSettingsReader interface is not relevant.

Permissions

See Also

Concepts

Persisting Settings

How to: Export Settings Using Interop Assemblies

How to: Export Settings Using the Managed Package Framework

Working with Settings

Reference

IVsSettingsWriter Interface

IVsSettingsWriter Members

Microsoft.VisualStudio.Shell.Interop Namespace

IVsSettingsReader

IVsSettingsWriter

ExportSettings