コード例 #1
0
        public ReplEditorUI(ReplEditorOptions options, IThemeManager themeManager, IWpfCommandManager wpfCommandManager, IMenuManager menuManager, ITextEditorSettings textEditorSettings)
        {
            this.dispatcher = Dispatcher.CurrentDispatcher;
            this.options    = (options ?? new ReplEditorOptions()).Clone();
            this.textEditor = new NewTextEditor(themeManager, textEditorSettings);
            this.textEditor.TextArea.Document = new TextDocument();
            this.textEditor.TextArea.Document.UndoStack.SizeLimit = 100;
            this.textEditor.TextArea.LeftMargins.Insert(0, new FrameworkElement {
                Margin = new Thickness(LEFT_MARGIN, 0, 0, 0)
            });
            this.textEditor.TextArea.TextEntering   += TextArea_TextEntering;
            this.textEditor.TextArea.PreviewKeyDown += TextArea_PreviewKeyDown;
            AddBinding(ApplicationCommands.Paste, (s, e) => Paste(), (s, e) => e.CanExecute      = CanPaste && IsAtEditingPosition);
            AddBinding(ApplicationCommands.Cut, (s, e) => CutSelection(), (s, e) => e.CanExecute = CanCutSelection && IsAtEditingPosition);

            if (this.options.TextEditorCommandGuid != null)
            {
                wpfCommandManager.Add(this.options.TextEditorCommandGuid.Value, textEditor);
            }
            if (this.options.TextAreaCommandGuid != null)
            {
                wpfCommandManager.Add(this.options.TextAreaCommandGuid.Value, textEditor.TextArea);
            }
            if (this.options.MenuGuid != null)
            {
                menuManager.InitializeContextMenu(this.textEditor, this.options.MenuGuid.Value, new GuidObjectsCreator(this), new ContextMenuInitializer(textEditor, textEditor));
            }
        }
コード例 #2
0
ファイル: ReplEditorUI.cs プロジェクト: GreenDamTan/dnSpy
		public ReplEditorUI(ReplEditorOptions options, IThemeManager themeManager, IWpfCommandManager wpfCommandManager, IMenuManager menuManager, ITextEditorSettings textEditorSettings) {
			this.dispatcher = Dispatcher.CurrentDispatcher;
			this.options = (options ?? new ReplEditorOptions()).Clone();
			this.textEditor = new NewTextEditor(themeManager, textEditorSettings);
			this.textEditor.TextArea.AllowDrop = false;
			this.textEditor.TextArea.Document = new TextDocument();
			this.textEditor.TextArea.Document.UndoStack.SizeLimit = 100;
			this.textEditor.TextArea.LeftMargins.Insert(0, new FrameworkElement { Margin = new Thickness(LEFT_MARGIN, 0, 0, 0) });
			this.textEditor.TextArea.TextEntering += TextArea_TextEntering;
			this.textEditor.TextArea.PreviewKeyDown += TextArea_PreviewKeyDown;
			AddBinding(ApplicationCommands.Paste, (s, e) => Paste(), (s, e) => e.CanExecute = CanPaste && IsAtEditingPosition);
			AddBinding(ApplicationCommands.Cut, (s, e) => CutSelection(), (s, e) => e.CanExecute = CanCutSelection && IsAtEditingPosition);

			if (this.options.TextEditorCommandGuid != null)
				wpfCommandManager.Add(this.options.TextEditorCommandGuid.Value, textEditor);
			if (this.options.TextAreaCommandGuid != null)
				wpfCommandManager.Add(this.options.TextAreaCommandGuid.Value, textEditor.TextArea);
			if (this.options.MenuGuid != null)
				menuManager.InitializeContextMenu(this.textEditor, this.options.MenuGuid.Value, new GuidObjectsCreator(this), new ContextMenuInitializer(textEditor, textEditor));
		}
コード例 #3
0
ファイル: NewTextEditor.cs プロジェクト: levisre/dnSpy
			public NewHighlighter(NewTextEditor textEditor, TextDocument document) {
				this.textEditor = textEditor;
				this.document = document;
			}
コード例 #4
0
ファイル: NewTextEditor.cs プロジェクト: levisre/dnSpy
			public NewHighlightingColorizer(NewTextEditor textEditor) {
				this.textEditor = textEditor;
			}
コード例 #5
0
 public ContextMenuInitializer(Control ctrl, NewTextEditor textEditor)
 {
     this.ctrl       = ctrl;
     this.textEditor = textEditor;
 }
コード例 #6
0
 public NewHighlighter(NewTextEditor textEditor, TextDocument document)
 {
     this.textEditor = textEditor;
     this.document   = document;
 }
コード例 #7
0
 public NewHighlightingColorizer(NewTextEditor textEditor)
 {
     this.textEditor = textEditor;
 }
コード例 #8
0
		public ContextMenuInitializer(Control ctrl, NewTextEditor textEditor) {
			this.ctrl = ctrl;
			this.textEditor = textEditor;
		}