예제 #1
0
 private static PyHKEY GetRootKey(object key) {
     PyHKEY rootKey;
     rootKey = key as PyHKEY;
     if (rootKey == null) {
         BigInteger bi = key as BigInteger;
         if (!Object.ReferenceEquals(bi, null)) {
             rootKey = new PyHKEY(RegistryKey.OpenRemoteBaseKey(MapSystemKey(bi), string.Empty));
         } else {
             throw new InvalidCastException("The object is not a PyHKEY object");
         }
     }
     return rootKey;
 }
예제 #2
0
 public static void CloseKey(PyHKEY key) {
     key.Close();
 }
예제 #3
0
        public static PyHKEY CreateKey(object key, string subKeyName) {
            PyHKEY rootKey = GetRootKey(key);

            //if key is a system key and no subkey is specified return that.
            BigInteger bi = key as BigInteger;
            if (!Object.ReferenceEquals(bi, null) && string.IsNullOrEmpty(subKeyName))
                return rootKey;

            PyHKEY subKey = new PyHKEY(rootKey.key.CreateSubKey(subKeyName));
            return subKey;
        }