Example #1
0
        public RegistryKeyMonitor(
            RegistryHive hive,
            string key,
            RegistryNotifyFilter filter,
            RegistryKeyWatch watch,
            KeyChangedDelegate keyChanged,
            ExceptionRaisedDelegate exceptionRaised)
        {
            if (keyChanged == null)
            {
                throw new ArgumentNullException(nameof(keyChanged));
            }

            if (exceptionRaised == null)
            {
                throw new ArgumentNullException(nameof(exceptionRaised));
            }

            RegistryHive         = hive;
            Key                  = key;
            Filter               = filter;
            WatchSubTree         = watch == RegistryKeyWatch.KeyAndSubKeys;
            this.keyChanged      = keyChanged;
            this.exceptionRaised = exceptionRaised;

            StartMonitor();
        }
Example #2
0
        public RegistryKeyMonitor(
            RegistryHive hive,
            string key,
            RegistryNotifyFilter filter,
            RegistryKeyWatch watch,
            KeyChangedDelegate keyChanged,
            ExceptionRaisedDelegate exceptionRaised)
        {
            if (keyChanged == null)
            {
                throw new ArgumentNullException(nameof(keyChanged));
            }

            if (exceptionRaised == null)
            {
                throw new ArgumentNullException(nameof(exceptionRaised));
            }

            RegistryHive = hive;
            Key = key;
            Filter = filter;
            WatchSubTree = watch == RegistryKeyWatch.KeyAndSubKeys;
            this.keyChanged = keyChanged;
            this.exceptionRaised = exceptionRaised;

            StartMonitor();
        }