/// <summary> /// Retrieves a readonly version of the specified subkey. /// </summary> /// <param name="name"> /// Name or path of the subkey to open. /// </param> /// <returns> /// The subkey requested, /// or a <c>null</c> reference if the operation failed. /// </returns> public override RegistryKeyBase OpenSubKey(string name) { var subKey = WrappedKey.OpenSubKey(name, false); if (subKey == null) { return(null); } return(new RegistryKeyWrapper(Hive, subKey)); }
public virtual string[] GetSubKeyNames() { try { return(Exists() ? WrappedKey.GetSubKeyNames() : Array.Empty <string>()); } catch (Exception ex) when(!ExceptionHandling.NotExpectedRegistryException(ex)) { throw new RegistryException(ex.Message, Name, ex); } }
public virtual object GetValue(string name) { try { return(Exists() ? WrappedKey.GetValue(name) : null); } catch (Exception ex) when(!ExceptionHandling.NotExpectedRegistryException(ex)) { throw new RegistryException(ex.Message, Name + "@" + name, ex); } }
/// <summary> /// Gets the names of all sub keys immediately below this registry key /// </summary> /// <returns></returns> public virtual string[] GetSubKeyNames() { try { return(Exists() ? WrappedKey.GetSubKeyNames() : new string[] { }); } catch (Exception ex) { if (NotExpectedException(ex)) { throw; } throw new RegistryException(ex.Message, Name, ex); } }
/// <summary> /// Retrieves the value associated with the specified name. /// Returns a <c>null</c> reference if the name/value pair /// does not exist in the registry. /// </summary> /// <param name="name"> /// The name of the value to retrieve. /// </param> /// <returns> /// The value associated with name, or a <c>null</c> reference /// if name is not found. /// </returns> public override object GetValue(string name) { return(WrappedKey.GetValue(name)); }
public string BuildPolicyKey(string[] vals) { return(WrappedKey.BuildPolicyKey(vals)); }
public string BuildPolicyKey() { return(WrappedKey.BuildPolicyKey()); }
public string BuildKey(params string[] vals) { return(WrappedKey.BuildKey(vals)); }