Пример #1
0
        /// <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));
        }
Пример #2
0
 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);
     }
 }
Пример #3
0
 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);
     }
 }
Пример #4
0
        /// <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);
            }
        }
Пример #5
0
 /// <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));
 }
Пример #6
0
 public string BuildPolicyKey(string[] vals)
 {
     return(WrappedKey.BuildPolicyKey(vals));
 }
Пример #7
0
 public string BuildPolicyKey()
 {
     return(WrappedKey.BuildPolicyKey());
 }
Пример #8
0
 public string BuildKey(params string[] vals)
 {
     return(WrappedKey.BuildKey(vals));
 }