Exemplo n.º 1
0
        public void Dispose()
        {
            if (MouseInput != null)
            {
                MouseInput.LeftButtonDown -= new MouseInput.MouseHookCallback(OnLeftMouseDown);
                MouseInput.Uninstall();
            }

            if (procDelegate != null)
            {
                UnsetHooks();
            }

            if (UpdateTimer != null || SnapTimer != null)
            {
                UpdateTimer.Stop();
                UpdateTimer.Dispose();

                SnapTimer.Stop();
                SnapTimer.Dispose();
            }

            if (CurrentLog != null)
            {
                //Write Log to File on Exit?
                CurrentLog.LogEntries.Clear();
            }
        }
Exemplo n.º 2
0
 public void Dispose()
 {
     Stop();
     ObservedProcess.ProcessOpened -= ObservedProcess_ProcessOpened;
     ObservedProcess.ProcessExited -= ObservedProcess_ProcessExited;
     UpdateTimer.Dispose();
 }
Exemplo n.º 3
0
 /// <summary>
 /// Освободить все используемые ресурсы.
 /// </summary>
 protected override void Dispose(bool disposing)
 {
     if (disposing && (components != null))
     {
         components.Dispose();
         UpdateTimer.Dispose();
     }
     base.Dispose(disposing);
 }
Exemplo n.º 4
0
        public void Dispose()
        {
            UpdateTimer.Stop();
            UpdateTimer.Elapsed -= OnTimerTick;
            UpdateTimer.Dispose();

            Client.OnReady -= OnClientReady;
            Client.ClearPresence();
            Client.Dispose();
        }
Exemplo n.º 5
0
 private void Dispose(bool disposing)
 {
     if (disposing)
     {
         UpdateTimer.Stop();
         UpdateTimer.Dispose();
         // free managed resources
         ClosePort(Port);
     }
     // free native resources if there are any.
 }
Exemplo n.º 6
0
 public void Dispose()
 {
     Stop();
     foreach (Notifier notifier in Notifiers)
     {
         notifier.Dispose();
     }
     ObservedProcess.ProcessOpened -= ObservedProcess_ProcessOpened;
     ObservedProcess.ProcessExited -= ObservedProcess_ProcessExited;
     UpdateTimer.Dispose();
 }
Exemplo n.º 7
0
        protected override void Dispose(bool disposing)
        {
            if (Context != null && !Context.IsDisposed)
            {
                foreach (var dis in Listeners.OfType <IDisposable>())
                {
                    try {
                        dis.Dispose();
                    } catch {
                        // Don't care
                    }
                }
            }
            Listeners.Clear();

            RenderContext.Dispose();
            UpdateTimer.Dispose();
            _stopwatch.Stop();
            base.Dispose(disposing);
        }
Exemplo n.º 8
0
        private void spinPollMinutes_ValueChanged(object sender, EventArgs e)
        {
            try
            {
                UpdateTimer.Stop();
                UpdateTimer.Dispose();
            }
            catch
            {
            }

            UpdateTimer = new Timer();

            ConfigurationSettings.PollForUpdates = (int)spinPollMinutes.Value;

            if (ConfigurationSettings.PollForUpdates > 0)
            {
                UpdateTimer.Interval = (int)TimeSpan.FromHours(ConfigurationSettings.PollForUpdates).TotalMilliseconds;
                UpdateTimer.Tick    += CheckForUpdates;
                UpdateTimer.Enabled  = true;
                UpdateTimer.Start();
            }
        }
 protected override void OnClosing(CancelEventArgs e)
 {
     UpdateTimer.Dispose();
     base.OnClosing(e);
 }
Exemplo n.º 10
0
 public void Dispose()
 {
     Stop();
     UpdateTimer.Dispose();
     Capture?.Dispose();
 }