tools/VsIdeHostAdapter/TargetAddIn/Common/RegistryHelper.cs
/// <summary>
/// Get value of the specified key in registry, returning defaultValue if it doesn't exist or cannot be read
/// </summary>
/// <param name="hive">Registry hive, like: Registry.LocalMachine.</param>
/// <param name="subkeyName">The name of the subkey under hive specified by the hive parameter.</param>
/// <param name="valueName">The name of the value. To get default key value, specify null.</param>
/// <param name="defaultValue">The value to return when key does not exist or not enough permissions or wrong key type.</param>
Get value of the specified key in registry, returning defaultValue if it doesn't exist or cannot be read
Get value of the specified key in registry returning defaultValue if it doesn ' t exist or cannot be read
internal static T GetValueIgnoringExceptions(RegistryKey hive, string subkeyName, string valueName, T defaultValue)
        {
            T value = defaultValue;
            if (!TryGetValueIgnoringExceptions(hive, subkeyName, valueName, out value))
                return defaultValue;
            return value;
        }
internal static T GetValueIgnoringExceptions ( RegistryKey hive , string subkeyName , string valueName , T defaultValue ) { T value = defaultValue ; if ( ! TryGetValueIgnoringExceptions ( hive , subkeyName , valueName , out value ) ) return defaultValue ; return value ; }
Get value of the specified key in registry, returning defaultValue if it doesn't exist or cannot be read
Get value of the specified key in registry returning defaultValue if it doesn ' t exist or cannot be read
hive
RegistryKey
Registry hive, like: Registry.LocalMachine.
Registry hive like : Registry . LocalMachine .
subkeyName
string
The name of the subkey under hive specified by the hive parameter.
The name of the subkey under hive specified by the hive parameter .
valueName
string
The name of the value. To get default key value, specify null.
The name of the value . To get default key value specify null .
defaultValue
T
The value to return when key does not exist or not enough permissions or wrong key type.
The value to return when key does not exist or not enough permissions or wrong key type .