protected virtual void Dispose(bool disposing) { if (disposing && _sapiRegKey != null && _disposeSapiKey) { Marshal.ReleaseComObject(_sapiRegKey); _sapiRegKey = null; } }
protected RegistryDataKey(string fullPath, IntPtr regHandle) { ISpRegDataKey spRegDataKey = (ISpRegDataKey) new SpDataKey(); SAPIErrorCodes sAPIErrorCodes = (SAPIErrorCodes)spRegDataKey.SetKey(regHandle, false); if (sAPIErrorCodes != 0 && sAPIErrorCodes != SAPIErrorCodes.SPERR_ALREADY_INITIALIZED) { throw new InvalidOperationException(); } _sapiRegKey = spRegDataKey; _sKeyId = fullPath; _disposeSapiKey = true; }
protected RegistryDataKey(string fullPath, ISpDataKey copyKey, bool shouldDispose) { _sKeyId = fullPath; _sapiRegKey = copyKey; _disposeSapiKey = shouldDispose; }
protected RegistryDataKey(string fullPath, RegistryDataKey copyKey) { _sKeyId = fullPath; _sapiRegKey = copyKey._sapiRegKey; _disposeSapiKey = copyKey._disposeSapiKey; }
public int CreateKey([MarshalAs(UnmanagedType.LPWStr)] string subKeyName, out ISpDataKey ppSubKey) { return(_sapiRegKey.CreateKey(subKeyName, out ppSubKey)); }