Exemplo n.º 1
0
 public SelectOptionPresenter(ITerminalView view,
                              String title,
                              IList <KeyValuePair <String, ITerminalPresenter> > options)
     : base(view, title)
 {
     this.Options = options;
 }
 public TerminalPresenterBase(ITerminalView view)
 {
     if (view == null)
     {
         throw new ArgumentNullException("view");
     }
     this.view   = view;
     this.Parent = this;
 }
Exemplo n.º 3
0
 public TerminalView(TerminalViewModel viewModel)
 {
     ViewModel = viewModel;
     ViewModel.SearchStarted         += OnSearchStarted;
     ViewModel.Activated             += OnActivated;
     ViewModel.ThemeChanged          += OnThemeChanged;
     ViewModel.OptionsChanged        += OnOptionsChanged;
     ViewModel.KeyBindingsChanged    += OnKeyBindingsChanged;
     ViewModel.FindNextRequested     += OnFindNextRequested;
     ViewModel.FindPreviousRequested += OnFindPreviousRequested;
     InitializeComponent();
     _terminalView = new XtermTerminalView();
     TerminalContainer.Children.Add((UIElement)_terminalView);
     _terminalView.Initialize(ViewModel);
 }
Exemplo n.º 4
0
        public void DisposalPrepare()
        {
            Bindings.StopTracking();
            TerminalContainer.Children.Remove((UIElement)_terminalView);
            _terminalView = null;

            Messenger.Default.Unregister(this);

            ViewModel.SearchStarted         -= OnSearchStarted;
            ViewModel.Activated             -= OnActivated;
            ViewModel.ThemeChanged          -= OnThemeChanged;
            ViewModel.FindNextRequested     -= OnFindNextRequested;
            ViewModel.FindPreviousRequested -= OnFindPreviousRequested;

            ViewModel = null;
        }
 public SelectOptionPresenter(ITerminalView view,
                              String title,
                              IList <KeyValuePair <String, ITerminalPresenter> > options)
     : base(view)
 {
     if (options == null)
     {
         throw new ArgumentNullException("options");
     }
     this.title   = title;
     this.options = options;
     foreach (var item in options)
     {
         item.Value.Parent = this;
     }
 }
Exemplo n.º 6
0
        public void DisposalPrepare()
        {
            Bindings.StopTracking();
            TerminalContainer.Children.Remove((UIElement)_terminalView);
            _terminalView = null;

            ViewModel.SearchStarted         -= OnSearchStarted;
            ViewModel.Activated             -= OnActivated;
            ViewModel.ThemeChanged          -= OnThemeChanged;
            ViewModel.OptionsChanged        -= OnOptionsChanged;
            ViewModel.KeyBindingsChanged    -= OnKeyBindingsChanged;
            ViewModel.FindNextRequested     -= OnFindNextRequested;
            ViewModel.FindPreviousRequested -= OnFindPreviousRequested;

            ViewModel = null;
        }
        public TerminalView(TerminalViewModel viewModel)
        {
            Messenger.Default.Register <KeyBindingsChangedMessage>(this, OnKeyBindingsChanged);
            Messenger.Default.Register <TerminalOptionsChangedMessage>(this, OnTerminalOptionsChanged);

            ViewModel = viewModel;
            ViewModel.SearchStarted         += OnSearchStarted;
            ViewModel.Activated             += OnActivated;
            ViewModel.ThemeChanged          += OnThemeChanged;
            ViewModel.FindNextRequested     += OnFindNextRequested;
            ViewModel.FindPreviousRequested += OnFindPreviousRequested;
            InitializeComponent();
            _terminalView = new XtermTerminalView();
            TerminalContainer.Children.Add((UIElement)_terminalView);
            _terminalView.Initialize(ViewModel);
            ViewModel.TerminalView = _terminalView;
            ViewModel.Initialized  = true;
        }
        public TerminalView(TerminalViewModel viewModel)
        {
            ViewModel = viewModel;
            ViewModel.SearchStarted         += OnSearchStarted;
            ViewModel.Activated             += OnActivated;
            ViewModel.ThemeChanged          += OnThemeChanged;
            ViewModel.FindNextRequested     += OnFindNextRequested;
            ViewModel.FindPreviousRequested += OnFindPreviousRequested;
            ViewModel.FontSizeChanged       += OnFontSizeChanged;
            InitializeComponent();
            _terminalView = new XtermTerminalView();
            TerminalContainer.Children.Add((UIElement)_terminalView);
            _terminalView.InitializeAsync(ViewModel);
            ViewModel.TerminalView = _terminalView;
            ViewModel.Initialized  = true;

            SetGridBackgroundTheme(ViewModel.TerminalTheme);

            viewModel.Overlay = (OverlayViewModel)MessageOverlay.DataContext;
        }
 public APlusBPresenter(ITerminalView view) : base(view)
 {
     this.InitializeStateActions();
     this.Reset();
 }
Exemplo n.º 10
0
 public ChainLinkMiddlePresenterBase(ITerminalView view, String title)
     : base(view, title)
 {
 }
		public TerminalController(
			ITerminalView view,
			SizeD charSize,
			int charsPerLine,
			Span prompt,
			Span promptWrap,
			Span promptOutput,
         Span promptOutputWrap,
			Colour defaultForegroundColour,
			Colour defaultBackgroundColour )
		{
			m_view = view;

			#region param checks
			if( view == null )
			{
				throw new ArgumentNullException( "view" );
			}

			if( charSize == null )
			{
				throw new ArgumentNullException( "charSize" );
			}

			if( prompt == null )
			{
				throw new ArgumentNullException( "prompt" );
			}

			if( promptWrap == null )
			{
				throw new ArgumentNullException( "promptWrap" );
			}

			if( promptOutput == null )
			{
				throw new ArgumentNullException( "promptOutput" );
			}

			if( defaultBackgroundColour == null )
			{
				throw new ArgumentNullException( "defaultBackgroundColour" );
			}

			if( defaultForegroundColour == null )
			{
				throw new ArgumentNullException( "defaultForegroundColour" );
			}
			#endregion

			Prompt = prompt;
			CharSize = charSize;
			CharsPerLine = charsPerLine;
			PromptWrap = promptWrap;
			PromptOutput = promptOutput;
         PromptOutputWrap = promptOutputWrap;
			DefaultBackgroundColour = defaultBackgroundColour;
			DefaultForegroundColour = defaultForegroundColour;

			Prompt.IsPrompt = true;
			promptWrap.IsPrompt = true;
			promptOutput.IsPrompt = true;
         promptOutputWrap.IsPrompt = true;

			ClearCurrentLine();
		}
		public TerminalController( ITerminalView view, SizeD charSize, int charsPerLine, Span prompt, Span promptWrap, Span promptOutput, Span promptOutputWrap )
         : this( view, charSize, charsPerLine, prompt, promptWrap, promptOutput, promptOutputWrap, Colours.White, Colours.Black )
		{
		}
        public TerminalController(
            ITerminalView view,
            SizeD charSize,
            int charsPerLine,
            Span prompt,
            Span promptWrap,
            Span promptOutput,
            Span promptOutputWrap,
            Colour defaultForegroundColour,
            Colour defaultBackgroundColour)
        {
            m_view = view;

            #region param checks
            if (view == null)
            {
                throw new ArgumentNullException("view");
            }

            if (charSize == null)
            {
                throw new ArgumentNullException("charSize");
            }

            if (prompt == null)
            {
                throw new ArgumentNullException("prompt");
            }

            if (promptWrap == null)
            {
                throw new ArgumentNullException("promptWrap");
            }

            if (promptOutput == null)
            {
                throw new ArgumentNullException("promptOutput");
            }

            if (defaultBackgroundColour == null)
            {
                throw new ArgumentNullException("defaultBackgroundColour");
            }

            if (defaultForegroundColour == null)
            {
                throw new ArgumentNullException("defaultForegroundColour");
            }
            #endregion

            Prompt                  = prompt;
            CharSize                = charSize;
            CharsPerLine            = charsPerLine;
            PromptWrap              = promptWrap;
            PromptOutput            = promptOutput;
            PromptOutputWrap        = promptOutputWrap;
            DefaultBackgroundColour = defaultBackgroundColour;
            DefaultForegroundColour = defaultForegroundColour;

            Prompt.IsPrompt           = true;
            promptWrap.IsPrompt       = true;
            promptOutput.IsPrompt     = true;
            promptOutputWrap.IsPrompt = true;

            ClearCurrentLine();
        }
 public TerminalController(ITerminalView view, SizeD charSize, int charsPerLine, Span prompt, Span promptWrap, Span promptOutput, Span promptOutputWrap)
     : this(view, charSize, charsPerLine, prompt, promptWrap, promptOutput, promptOutputWrap, Colours.White, Colours.Black)
 {
 }
Exemplo n.º 15
0
 /// <summary>
 /// Bad constructor - uses null options.
 /// </summary>
 /// <param name="view"></param>
 /// <param name="title"></param>
 public SelectOptionPresenter(ITerminalView view,
                              String title)
     : this(view, title, null)
 {
 }