Example #1
0
 internal NotifyChangeKeyValue(
     bool watchSubtree,
     Win32Api.REG_NOTIFY_CHANGE notifyFilter,
     IntPtr hEvent,
     bool asynchronous)
 {
     watchSubtree_ = watchSubtree;
     notifyFilter_ = notifyFilter;
     hEvent_       = hEvent;
     asynchronous_ = asynchronous;
 }
Example #2
0
 internal static void NotifyChangeKeyValue(
     this VirtualKey key,
     bool watchSubtree,
     Win32Api.REG_NOTIFY_CHANGE notifyFilter,
     IntPtr hEvent,
     bool asynchronous)
 {
     if (!key.TryApplyOperation(KeyDisposition.WINDOWS_REG, null,
                                new KeySecurity(Win32Api.KeySecurity.KEY_NOTIFY),
                                keyImpl => keyImpl.TryApply(new NotifyChangeKeyValue(watchSubtree, notifyFilter,
                                                                                     hEvent, asynchronous))))
     {
         throw new FileNotFoundException();
     }
 }