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.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.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
'Declaração
Public Function GetBooleanValue ( _
key As RegistryKey, _
name As String, _
def As Boolean _
) As Boolean
public bool GetBooleanValue(
RegistryKey key,
string name,
bool def
)
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.