Поделиться через


IVsSettingsReader.ReadSettingBytes Method

Returns the values of an array stored 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 ReadSettingBytes ( _
    pszSettingName As String, _
    <OutAttribute> ByRef pSettingValue As Byte, _
    <OutAttribute> ByRef plDataLength As Integer, _
    lDataMax As Integer _
) As Integer
int ReadSettingBytes(
    string pszSettingName,
    out byte pSettingValue,
    out int plDataLength,
    int lDataMax
)
int ReadSettingBytes(
    [InAttribute] String^ pszSettingName, 
    [InAttribute] [OutAttribute] unsigned char% pSettingValue, 
    [OutAttribute] int% plDataLength, 
    [InAttribute] int lDataMax
)
abstract ReadSettingBytes : 
        pszSettingName:string * 
        pSettingValue:byte byref * 
        plDataLength:int byref * 
        lDataMax:int -> int 
function ReadSettingBytes(
    pszSettingName : String, 
    pSettingValue : byte, 
    plDataLength : int, 
    lDataMax : int
) : int

Parameters

  • pszSettingName
    Type: System.String
    [in] String uniquely identifying the data element to be retrieved.
  • pSettingValue
    Type: System.Byte%
    [in, out] Buffer to receive byte data retrieved from the specified data element of the Visual Studio settings file.
  • plDataLength
    Type: System.Int32%
    [out] Number of byte values returned.
  • lDataMax
    Type: System.Int32
    [in] Maximum number of bytes to be returned. If size of the stored data is greater than lDataMax, an error is returned.

Return Value

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

Remarks

The value of plDataLength must always be less than or equal to lDataMax.

Any buffer used to receive the retrieved data (pSettingValue) should be at least lDataMax bytes in size.

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

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

.NET Framework Security

See Also

Reference

IVsSettingsReader Interface

Microsoft.VisualStudio.Shell.Interop Namespace

IVsSettingsReader

IVsSettingsWriter

ImportSettings

Other Resources

Persisting Settings

How to: Use Interop Assemblies to Import Settings

How to: Import Settings By Using the Managed Package Framework

Visual Studio Settings