API Reference
RegistryPolicyProxy
Proxies IPolicySource calls to the Windows registry.
Inheritance
- Object
- RegistryPolicyProxy
Constructors
public RegistryPolicyProxy(RegistryHive hive, RegistryView view = Default) #Initializes a new instance wrapping an existing key.
Parameters
- key Microsoft.Win32.RegistryKey
- Root registry key.
- ownsKey System.Boolean = Default
- When true, the key will be disposed with this instance.
RegistryPolicyProxy(Microsoft.Win32.RegistryHive hive, Microsoft.Win32.RegistryView view) #Initializes a new instance for the specified hive.
Parameters
- hive Microsoft.Win32.RegistryHive
- Registry hive to open.
- view Microsoft.Win32.RegistryView
- Registry view.
Methods
public virtual Void ClearKey(String key) #VoidDeletes all values under the specified key (does not remove the key itself).
Parameters
- key System.String
- Registry key path.
public virtual Boolean ContainsValue(String key, String value) #BooleanDetermines whether the specified registry value exists.
Parameters
- key System.String
- Registry key path.
- value System.String
- Registry value name.
Returns
true if the value is present; otherwise false.
public virtual Void DeleteValue(String key, String value) #VoidDeletes the specified value if it exists.
Parameters
- key System.String
- Registry key path.
- value System.String
- Registry value name.
public virtual Void Dispose() #VoidReleases resources associated with this proxy. If this instance owns the root key, the underlying RegistryKey is disposed.
public virtual Void ForgetKeyClearance(String key) #VoidStops tracking key clearance operations. No-op for live registry sources.
Parameters
- key System.String
- Registry key path.
public virtual Void ForgetValue(String key, String value) #VoidStops tracking the specified value. No-op for live registry sources.
Parameters
- key System.String
- Registry key path.
- value System.String
- Registry value name.
public virtual IReadOnlyList<String> GetSubKeyNames(String key) #IReadOnlyList<String>Gets subkey names under the specified key.
Parameters
- key System.String
public virtual Object GetValue(String key, String value) #ObjectGets the registry value data for the specified key/value.
Parameters
- key System.String
- Registry key path.
- value System.String
- Registry value name.
Returns
Value data or null when missing.
public virtual IReadOnlyList<String> GetValueNames(String key) #IReadOnlyList<String>Gets all value names defined under the specified key.
Parameters
- key System.String
- Registry key path.
Returns
List of value names; empty when the key does not exist.
public virtual Void SetValue(String key, String value, Object data, RegistryValueKind dataType) #VoidSets a registry value.
Parameters
- key System.String
- Registry key path.
- value System.String
- Registry value name.
- data System.Object
- Value data.
- dataType Microsoft.Win32.RegistryValueKind
- Registry value type.
public virtual Boolean WillDeleteValue(String key, String value) #BooleanIndicates whether the specified value is scheduled to be deleted. For live registry sources, deletion is executed immediately so this always returns false.
Parameters
- key System.String
- Registry key path.
- value System.String
- Registry value name.
Returns
Always false for this implementation.
Inherited Methods
Properties
public RegistryKey RootKey { get; } #Gets the wrapped root key.