void SelectLog(int tmpIndex) { var vm = OutputService.SelectLog(tmpIndex); Debug2.Assert(!(vm is null)); if (vm is null) { return; } vm.FocusedElement?.Focus(); // Must use Loaded prio or the normal text editor could get focus Dispatcher.CurrentDispatcher.BeginInvoke(DispatcherPriority.Loaded, new Action(() => { if (OutputService.SelectedOutputBufferVM == vm) { vm.FocusedElement?.Focus(); } })); }
OutputContent(IWpfCommandService wpfCommandService, Lazy <IOutputServiceInternal> outputVM) { outputControl = new OutputControl(); vmOutput = outputVM; wpfCommandService.Add(ControlConstants.GUID_OUTPUT_CONTROL, outputControl); var cmds = wpfCommandService.GetCommands(ControlConstants.GUID_OUTPUT_CONTROL); cmds.Add(ApplicationCommands.Save, (s, e) => OutputService.SaveText(), (s, e) => e.CanExecute = OutputService.CanSaveText); cmds.Add(OutputCommands.CopyCommand, (s, e) => OutputService.Copy(), (s, e) => e.CanExecute = OutputService.CanCopy); cmds.Add(OutputCommands.CopyCommand, ModifierKeys.Control, Key.C); cmds.Add(OutputCommands.CopyCommand, ModifierKeys.Control, Key.Insert); cmds.Add(OutputCommands.ClearAllCommand, (s, e) => OutputService.ClearAll(), (s, e) => e.CanExecute = OutputService.CanClearAll); cmds.Add(OutputCommands.ClearAllCommand, ModifierKeys.Control, Key.L); cmds.Add(OutputCommands.ToggleWordWrapCommand, (s, e) => OutputService.WordWrap = !OutputService.WordWrap, (s, e) => e.CanExecute = true); cmds.Add(OutputCommands.ToggleShowLineNumbersCommand, (s, e) => OutputService.ShowLineNumbers = !OutputService.ShowLineNumbers, (s, e) => e.CanExecute = true); cmds.Add(OutputCommands.ToggleShowTimestampsCommand, (s, e) => OutputService.ShowTimestamps = !OutputService.ShowTimestamps, (s, e) => e.CanExecute = true); for (int i = 0; i < OutputCommands.SelectLogWindowCommands.Length; i++) { int tmpIndex = i; cmds.Add(OutputCommands.SelectLogWindowCommands[i], (s, e) => SelectLog(tmpIndex), (s, e) => e.CanExecute = OutputService.CanSelectLog(tmpIndex)); } outputControl.PreviewKeyDown += OutputControl_PreviewKeyDown; }
public NotPresentOutputWriter(OutputService outputService, Guid guid) { this.outputService = outputService; this.guid = guid; }
public NotPresentOutputWriter(OutputService outputService, Guid guid) { this.outputService = outputService; this.guid = guid; }