Ejemplo n.º 1
0
        private static CommandResult CmdSelectAll(ICommandTarget target)
        {
            CharacterDocumentViewer tc = TerminalCommandTarget.AsCharacterDocumentViewer(target);

            if (tc == null)
            {
                return(CommandResult.Ignored);
            }
            tc.ITextSelection.SelectAll();
            tc.Invalidate();
            return(CommandResult.Succeeded);
        }
Ejemplo n.º 2
0
            public CharacterDocumentViewerContainer(CharacterDocument doc)
            {
                _viewer = new CharacterDocumentViewer();
                _viewer.SetContent(doc, GEnv.DefaultRenderProfile);
                _viewer.Dock = DockStyle.Fill;

                _caretTimer          = new System.Windows.Forms.Timer();
                _caretTimer.Interval = Win32.GetCaretBlinkTime();
                _caretTimer.Tick    += new EventHandler(this.OnCaretTimer);
                _caretTimer.Start();

                this.Controls.Add(_viewer);
                this.Size = new Size(300, 300);
            }
Ejemplo n.º 3
0
        private static string GetSelectedText(ICommandTarget target, TextFormatOption opt)
        {
            CharacterDocumentViewer c = TerminalCommandTarget.AsCharacterDocumentViewer(target);

            if (c == null)
            {
                return(null);
            }
            ITextSelection s = c.ITextSelection;

            if (s.IsEmpty || !c.EnabledEx)
            {
                return(null);
            }

            return(s.GetSelectedText(opt));
        }
Ejemplo n.º 4
0
        public CommandResult InternalExecute(ICommandTarget target, params IAdaptable[] args)
        {
            CharacterDocumentViewer control = (CharacterDocumentViewer)target.GetAdapter(typeof(CharacterDocumentViewer));
            ITextSelection          s       = control.ITextSelection;

            if (s.IsEmpty || !control.EnabledEx)
            {
                return(CommandResult.Ignored);
            }

            string t = s.GetSelectedText(TextFormatOption.Default);

            if (t.Length > 0)
            {
                CopyToClipboard(t);
            }
            return(CommandResult.Succeeded);
        }
Ejemplo n.º 5
0
        public bool CanExecute(ICommandTarget target)
        {
            CharacterDocumentViewer control = (CharacterDocumentViewer)target.GetAdapter(typeof(CharacterDocumentViewer));

            return(control.EnabledEx && !control.ITextSelection.IsEmpty);
        }
Ejemplo n.º 6
0
 public ViewBridge()
 {
     _viewer = new CharacterDocumentViewer(); //セッション固有コントロールとする
     _viewer.SetPrivateRenderProfile(TerminalEmulatorPlugin.Instance.TerminalEmulatorOptions.CreateRenderProfile());
 }