private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { //TODO: Check for memmory leaks. foreach (CancellationTokenSource tokenSource in CancellationTokenList) { tokenSource.Cancel(); } _encoder = null; GC.Collect(); }
/// <summary> /// Shows the Encoder window. /// </summary> /// <param name="scale">Screen scale.</param> public static void Start(double scale) { #region If already started if (_encoder != null) { if (_encoder.WindowState == WindowState.Minimized) { Restore(); } return; } #endregion _encoder = new Encoder(); var screen = GetScreen(_encoder); //Lower Right corner. _encoder.Left = (screen.WorkingArea.Width / scale - _encoder.Width) ; _encoder.Top = (screen.WorkingArea.Height / scale - _encoder.Height); _encoder.Show(); }
/// <summary> /// Shows the Encoder window. /// </summary> public static void Start() { if (_encoder != null) { if (_encoder.WindowState == WindowState.Minimized) { Restore(); } } _encoder = new Encoder(); var screen = GetScreen(_encoder); //Lower Right corner. _encoder.Left = screen.WorkingArea.Width - _encoder.Width; _encoder.Top = screen.WorkingArea.Height - _encoder.Height; _encoder.Show(); }