コード例 #1
0
ファイル: Output.cs プロジェクト: krupineg/Tobii.Build.Robot
 public void Show(IOutputView outputView)
 {
     foreach (var outputStream in _streams)
     {
         outputStream.Show(outputView);
     }
 }
コード例 #2
0
        /// <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;
        }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
ファイル: OutputViewModel.cs プロジェクト: FactrIDE/FactrIDE
        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;
            }
        }
コード例 #5
0
        protected override void OnViewLoaded(object view)
        {
            _view = (IOutputView)view;
            if (_view == null)
            {
                throw new InvalidCastException();
            }

            _view.SetText(_stringBuilder.ToString());
            _view.ScrollToEnd();

            base.OnViewLoaded(view);
        }
コード例 #6
0
ファイル: OutputViewModel.cs プロジェクト: FactrIDE/FactrIDE
        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;
        }
コード例 #7
0
        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());
コード例 #8
0
 public OutputPresenter(IOutputView view)
     : base(view)
 {
     view.SetPresenter(this);
 }
コード例 #9
0
 protected override void OnViewLoaded(object view)
 {
     _view = (IOutputView)view;
     _view.SetText(_stringBuilder.ToString());
     _view.ScrollToEnd();
 }
コード例 #10
0
 public void Show(IOutputView textView)
 {
     textView.Present(this);
 }
コード例 #11
0
 public void Show(IOutputView view)
 {
     view.Present(this);
 }
コード例 #12
0
 protected override void OnViewLoaded(object view)
 {
     _view = (IOutputView)view;
     _view.StartScrollTimer();
 }
コード例 #13
0
        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());
        }
コード例 #14
0
 public FileRenderer(IOutputView outputView)
 {
     _outputView = outputView;
 }
コード例 #15
0
 protected override void OnViewLoaded(object view)
 {
     _view = (IOutputView) view;
     _view.ScrollToEnd();
 }
コード例 #16
0
ファイル: OutputViewModel.cs プロジェクト: tgjones/gemini
 protected override void OnViewLoaded(object view)
 {
     _view = (IOutputView) view;
     _view.SetText(_stringBuilder.ToString());
     _view.ScrollToEnd();
 }
コード例 #17
0
 protected override void OnViewLoaded(object view)
 {
     _view = (IOutputView)view;
     _view.ScrollToEnd();
 }
コード例 #18
0
 public OutputPresenter(IOutputView view)
     : base(view)
 {
     view.SetPresenter(this);
 }