LanguagePreferences.GetBooleanValue Method
Obtains a boolean value from the specified registry entry.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
‘선언
Public Function GetBooleanValue ( _
key As RegistryKey, _
name As String, _
def As Boolean _
) As Boolean
‘사용 방법
Dim instance As LanguagePreferences
Dim key As RegistryKey
Dim name As String
Dim def As Boolean
Dim returnValue As Boolean
returnValue = instance.GetBooleanValue(key, _
name, def)
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: Microsoft.Win32.RegistryKey
[in] The RegistryKey object representing the desired registry subkey.
- name
Type: System.String
[in] The name of the registry entry for which to get the value.
- def
Type: System.Boolean
[in] The default value to use if the registry entry is not found.
Return Value
Type: System.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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.