src/Microsoft/Windows/ComponentObjectModel/Shell/_Library/ShellExtensionManager.cs
/// <summary>
/// Retrieves the classes registry key for a specific registration scope.
/// </summary>
/// <param name="scope">The registration scope.</param>
/// <param name="writable">Controls, if the returned Registry Key is opened writable.</param>
/// <returns>The scoped classes registry key.</returns>
Retrieves the classes registry key for a specific registration scope.
Retrieves the classes registry key for a specific registration scope .
IRegistryKey GetScopedClassesKey( ComponentRegistrationScope scope, bool writable ) {
            RegistryHive hive;
            switch( scope ) {
                case ComponentRegistrationScope.System: {
                        hive = RegistryHive.LocalMachine;
                        break;
                    }
                case ComponentRegistrationScope.User: {
                        hive = RegistryHive.CurrentUser;
                        break;
                    }
                case ComponentRegistrationScope.None:
                case ComponentRegistrationScope.Unknown:
                default: {
                        throw new ArgumentOutOfRangeException( nameof( scope ) );
                    }
            }
            using( IRegistryKey hiveKey = _registry.OpenBaseKey( hive, RegistryView.Default ) ) {
                return hiveKey.OpenSubKey( @"Software\Classes\", writable );
            }
        }
IRegistryKey GetScopedClassesKey ( ComponentRegistrationScope scope , bool writable ) { RegistryHive hive ; switch ( scope ) { case ComponentRegistrationScope . System : { hive = RegistryHive . LocalMachine ; break ; } case ComponentRegistrationScope . User : { hive = RegistryHive . CurrentUser ; break ; } case ComponentRegistrationScope . None : case ComponentRegistrationScope . Unknown : default : { throw new ArgumentOutOfRangeException ( nameof ( scope ) ) ; } } using ( IRegistryKey hiveKey = _registry . OpenBaseKey ( hive , RegistryView . Default ) ) { return hiveKey . OpenSubKey ( @"Software\Classes\" , writable ) ; } }
Retrieves the classes registry key for a specific registration scope.
Retrieves the classes registry key for a specific registration scope .
The scoped classes registry key.
The scoped classes registry key .
scope
ComponentRegistrationScope
The registration scope.
The registration scope .
writable
bool
Controls, if the returned Registry Key is opened writable.
Controls if the returned Registry Key is opened writable .