Compartilhar via


LanguagePreferences.GetBooleanValue Method

Obtains a boolean value from the specified registry entry.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)

Syntax

'Declaration
Public Function GetBooleanValue ( _
    key As RegistryKey, _
    name As String, _
    def As Boolean _
) As Boolean
public bool GetBooleanValue(
    RegistryKey key,
    string name,
    bool def
)
public:
bool GetBooleanValue(
    RegistryKey^ key, 
    String^ name, 
    bool def
)
member GetBooleanValue : 
        key:RegistryKey * 
        name:string * 
        def:bool -> bool
public function GetBooleanValue(
    key : RegistryKey, 
    name : String, 
    def : boolean
) : boolean

Parameters

  • key
    Type: RegistryKey

    [in] The RegistryKey object representing the desired registry subkey.

  • name
    Type: String

    [in] The name of the registry entry for which to get the value.

  • def
    Type: Boolean

    [in] The default value to use if the registry entry is not found.

Return Value

Type: Boolean
rue if the registry entry exists and contains a non-zero value or the word "True" (case-insensitive comparison), false if the registry entry exists and contains a zero value or the word "False" (case-insensitive comparison). Otherwise, returns the default value specified in def. Note: if the registry entry is a string, then any string other than "True" or "False" throws a FormatException.

Remarks

This is a helper method used for obtaining boolean values from the registry. It is typically called from the InitMachinePreferences method.

.NET Framework Security

See Also

Reference

LanguagePreferences Class

Microsoft.VisualStudio.Package Namespace