Exemple #1
0
        /// <summary>
        /// Same as <see cref=&quotGetSubKey"/>, but this method forces the creation
        /// where <see cref=&quotGetSubKey"/> just returns the object which will create
        /// itself when needed (a value is set)
        /// </summary>
        /// <param name=&quotName"></param>
        /// <returns></returns>
        public RegKey CreateSubKey(string Name)
        {
            RegKey key = GetSubKey(Name);

            if (!key.Exists())
            {
                key.Create();
            }
            return(key);
        }
Exemple #2
0
 /// <summary>
 /// Get the registry information if not done so already after the last Refresh
 /// </summary>
 protected void GetKey()
 {
     if (!regkeysSearched)
     {
         regkeysSearched = true;
         if (Root == null)
         {
             if (rootkey == null)
             {
                 throw new Exception("No root was specified!");
             }
         }
         else if (Root.Exists())
         {
             //RegistryKey classes = ;
             rootkey = Root.RegistryKey;
         }
         if (rootkey != null)
         {
             regkey = rootkey.OpenSubKey(name, writable);
         }
         onKeyChanged();
     }
 }