public void Show(IOutputView outputView) { foreach (var outputStream in _streams) { outputStream.Show(outputView); } }
/// <summary> Constructor. </summary> /// <param name="owner"> The application controller for cross controller communication. </param> /// <param name="outputView"> The view that is attached to the controller. </param> public OutputController(ApplicationController owner, IOutputView outputView) { _owner = owner; _outputView = outputView; _outputView.CopyToClipboardRequested += CopyToClipboard; _outputView.ExportRequested += OutputViewOnExportRequested; }
/// <summary> /// Initializes a new instance of the <see cref="OutputToolWindow"/> class. /// </summary> public OutputToolWindow(IOutputView view) : base(null) { Caption = "Tanzu Output"; // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable, // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on // the object returned by the Content property. Content = view; }
protected override void OnViewLoaded(object view) { _view = (IOutputView)view; _view.SetText(StringBuilder.ToString()); _view.ScrollToEnd(); if (view is OutputView outputView) { outputView.Loaded += OnLoaded; outputView.Unloaded += OnUnloaded; } }
protected override void OnViewLoaded(object view) { _view = (IOutputView)view; if (_view == null) { throw new InvalidCastException(); } _view.SetText(_stringBuilder.ToString()); _view.ScrollToEnd(); base.OnViewLoaded(view); }
protected override void OnViewLoaded(object view) { _view = (IOutputView)view; _view.SetText(StringBuilder.ToString()); _view.ScrollToEnd(); if (view is OutputView outputView) { outputView.Loaded += OnLoaded; outputView.Unloaded += OnUnloaded; } LogWatcher.EnableRaisingEvents = true; }
public void RenderTo(IOutputView view) { view.HideCursor(); for (var lineNumber = StartingLine; lineNumber < StartingLine + Height; lineNumber++) { view.MoveCursorTo(0, lineNumber - StartingLine); if (lineNumber >= Text.Lines.Count) { view.WriteText(new string(' ', Width)); continue; } var line = Text.Lines[lineNumber]; var startsIn = StartingColumn; foreach (var chunk in line.Chunks) { var left = Math.Max(0, startsIn); var right = Math.Min(chunk.Width, startsIn + Width); if (left < right) { view.SetStyle(chunk.Style); view.WriteText(chunk.Text[left..right].ToString());
public OutputPresenter(IOutputView view) : base(view) { view.SetPresenter(this); }
protected override void OnViewLoaded(object view) { _view = (IOutputView)view; _view.SetText(_stringBuilder.ToString()); _view.ScrollToEnd(); }
public void Show(IOutputView textView) { textView.Present(this); }
public void Show(IOutputView view) { view.Present(this); }
protected override void OnViewLoaded(object view) { _view = (IOutputView)view; _view.StartScrollTimer(); }
public OutputViewModel(IOutputView view, IEventAggregator eventAggregator) { View = view; View.DataContext = this; _eventAggregator = eventAggregator; LastCommands = new ObservableCollection <string>(); Logs = string.Empty; _eventAggregator.GetEvent <LogEvent>().Subscribe(msg => { if (msg.Port == Port) { Logs += msg.Message; if (Logs.Length > LOGS_LENGHT) { Logs = Logs.Substring(Logs.Length - LOGS_LENGHT); } } }, ThreadOption.UIThread); EnterCommand = new DelegateCommand(() => { _eventAggregator.GetEvent <CommandEvent>().Publish(new CommandModel(Port, Command)); LastCommands.Add(Command); if (LastCommands.Count > 100) { LastCommands.RemoveAt(0); } _cmdIndex = LastCommands.Count; Command = string.Empty; }, () => Connected); UpCommand = new DelegateCommand(() => { if (_cmdIndex > 0) { _cmdIndex--; Command = LastCommands[_cmdIndex]; View.SetFocus(); View.SetCursorPosition(); } View.SetFocus(); }, () => Connected); DownCommand = new DelegateCommand(() => { if (_cmdIndex < LastCommands.Count - 1) { _cmdIndex++; Command = LastCommands[_cmdIndex]; View.SetFocus(); View.SetCursorPosition(); } else { _cmdIndex = LastCommands.Count; Command = String.Empty; } View.SetFocus(); }, () => Connected); ClearCommand = new DelegateCommand(() => Logs = String.Empty); _eventAggregator.GetEvent <ConnectEvent>().Subscribe(ip => Connected = true); _eventAggregator.GetEvent <DisconnectEvent>().Subscribe(obj => Connected = false); _eventAggregator.GetEvent <ClearLogsEvent>().Subscribe(obj => ClearCommand.Execute()); }
public FileRenderer(IOutputView outputView) { _outputView = outputView; }
protected override void OnViewLoaded(object view) { _view = (IOutputView) view; _view.ScrollToEnd(); }
protected override void OnViewLoaded(object view) { _view = (IOutputView) view; _view.SetText(_stringBuilder.ToString()); _view.ScrollToEnd(); }
protected override void OnViewLoaded(object view) { _view = (IOutputView)view; _view.ScrollToEnd(); }