private void OpenDiag() { if (CasparExecutable is null || !CasparExecutable.Running) { return; } CasparExecutable.Write("DIAG"); }
private void OpenDiag(Executable ex) { if (ex is null || !ex.Running) { return; } ex.Write("DIAG"); }
private void Launcher_KeyUp(object sender, KeyEventArgs e) { if (Keyboard.IsKeyUp(Key.LeftShift) || Keyboard.IsKeyUp(Key.RightShift)) { IsShiftDown = false; } IInputElement focused = FocusManager.GetFocusedElement(this); if (focused is TextBox) { TextBox target = focused as TextBox; if (target.Name == "ConsoleCommandTextBox") { object context = target.DataContext; Executable executable = (context is Executable) ? context as Executable : null; if (executable is null || !executable.AllowCommands) { return; } if (e.Key == Key.Enter) { executable.Write(); } if (e.Key == Key.Up) { executable.PreviousHistoryCommand(); target.CaretIndex = target.Text.Length; } if (e.Key == Key.Down) { executable.NextHistoryCommand(); target.CaretIndex = target.Text.Length; } } } }