Freigeben über


IVsSettingsWriter.WriteSettingLong Method

Stores the value of a Long 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

'Declaration
Function WriteSettingLong ( _
    pszSettingName As String, _
    lSettingValue As Integer _
) As Integer
int WriteSettingLong(
    string pszSettingName,
    int lSettingValue
)
int WriteSettingLong(
    [InAttribute] String^ pszSettingName, 
    [InAttribute] int lSettingValue
)
abstract WriteSettingLong : 
        pszSettingName:string * 
        lSettingValue:int -> int
function WriteSettingLong(
    pszSettingName : String, 
    lSettingValue : int
) : int

Parameters

  • pszSettingName
    Type: String

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

  • lSettingValue
    Type: Int32

    [in] Long (32-bit Integer) value to be stored as the specified data element of the Visual Studio settings file.

Return Value

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

Remarks

COM Signature

From vsshell80.idl:

HRESULT WriteSettingLong
   (LPCOLESTR pszSettingName, 
   long lSettingValue
   );

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 WriteSettingLong with respect to other methods of the IVsSettingsReader interface is not relevant.

.NET Framework Security

See Also

Reference

IVsSettingsWriter Interface

Microsoft.VisualStudio.Shell.Interop Namespace

IVsSettingsReader

IVsSettingsWriter

ExportSettings

Other Resources

Persisting Settings

How to: Use Interop Assemblies to Import Settings

Working with Settings