Пример #1
0
        private void LoadRegistryMonitor()
        {
            _currentLoadedEnvironment = _loadedSettings.Environments.Find(env => env.SubkeyValue == (string)Registry.GetValue(_loadedSettings.MonitoredRegistryKey.Root, _loadedSettings.MonitoredRegistryKey.Subkey, ""));
            SetIcon();

            _registryMonitor = new RegistryUtils.RegistryMonitor(_loadedSettings.MonitoredRegistryKey.Root)
            {
                RegChangeNotifyFilter = RegChangeNotifyFilter.Value
            };
            _registryMonitor.RegChanged += OnRegChanged;
            _registryMonitor.Error      += OnError;
            _registryMonitor.Start();
            _currentMonitoredRegistryKey = _loadedSettings.MonitoredRegistryKey;
        }
Пример #2
0
        private void SetNewRegistrykeyIfChanged()
        {
            if (_currentMonitoredRegistryKey == _loadedSettings.MonitoredRegistryKey)
            {
                return;
            }

            _registryMonitor.Stop();
            _registryMonitor.Dispose();

            _registryMonitor = new RegistryUtils.RegistryMonitor(_loadedSettings.MonitoredRegistryKey.Root)
            {
                RegChangeNotifyFilter = RegChangeNotifyFilter.Value
            };
            _registryMonitor.RegChanged += OnRegChanged;
            _registryMonitor.Error      += OnError;
            _registryMonitor.Start();
            _currentMonitoredRegistryKey = _loadedSettings.MonitoredRegistryKey;
        }
Пример #3
0
        private void SetNewRegistrykeyIfChanged()
        {
            if (_currentMonitoredRegistryKey == _loadedSettings.MonitoredRegistryKey) return;

            _registryMonitor.Stop();
            _registryMonitor.Dispose();

            _registryMonitor = new RegistryUtils.RegistryMonitor(_loadedSettings.MonitoredRegistryKey.Root)
            {
                RegChangeNotifyFilter = RegChangeNotifyFilter.Value
            };
            _registryMonitor.RegChanged += OnRegChanged;
            _registryMonitor.Error += OnError;
            _registryMonitor.Start();
            _currentMonitoredRegistryKey = _loadedSettings.MonitoredRegistryKey;
        }
Пример #4
0
        private void LoadRegistryMonitor()
        {
            _currentLoadedEnvironment = _loadedSettings.Environments.Find(env => env.SubkeyValue == (string)Registry.GetValue(_loadedSettings.MonitoredRegistryKey.Root, _loadedSettings.MonitoredRegistryKey.Subkey, ""));
            SetIcon();

            _registryMonitor = new RegistryUtils.RegistryMonitor(_loadedSettings.MonitoredRegistryKey.Root)
            {
                RegChangeNotifyFilter = RegChangeNotifyFilter.Value
            };
            _registryMonitor.RegChanged += OnRegChanged;
            _registryMonitor.Error += OnError;
            _registryMonitor.Start();
            _currentMonitoredRegistryKey = _loadedSettings.MonitoredRegistryKey;
        }
		private void OnButtonStartClick(object sender, EventArgs e)
		{
			string keyName = string.Format("{0}\\{1}", comboBoxRegistryHives.SelectedValue.ToString(), textRegistryKey.Text);

			listBox1.Items.Add("Monitoring \"" + keyName + "\" started");
			registryMonitor = new RegistryMonitor(keyName);
            registryMonitor.RegChanged += new EventHandler(OnRegChanged);
            registryMonitor.Error += new System.IO.ErrorEventHandler(OnError);
            registryMonitor.Start();

			buttonStart.Enabled = false;
			buttonStop.Enabled = true;
		}