Exemplo n.º 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;
 }
Exemplo n.º 2
0
 public static void CloseKey(PyHKEY key) {
     key.Close();
 }
Exemplo n.º 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;
        }