public new void Dispose() { if ((null != _applicationObserver) && (!this.DesignMode)) { _applicationObserver.Dispose(); _applicationObserver = null; } base.Dispose(); }
public ApplicationObserverControl() { try { InitializeComponent(); if (!DesignMode) { _applicationObserver = new OfficeApplicationObserver(listViewApps); textBoxHotKey.Text = _applicationObserver.HotKey.ToString(); _applicationObserver.InstanceRunningCountChanged += new EventHandler(_applicationObserver_InstanceRunningCountChanged); _applicationObserver.AllProcessesChanged += new EventHandler(_applicationObserver_AllProcessesChanged); } } catch (Exception exception) { ErrorForm errorForm = new ErrorForm(exception, ErrorCategory.NonCritical, _currentLanguageID); errorForm.ShowDialog(this); } }