LanguagePreferences::GetBooleanValue Method (RegistryKey^, String^, Boolean)

 

Obtains a boolean value from the specified registry entry.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

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.

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

Return to top
Show: