Example #1
0
        public ConsoleControl()
        {
            this.ColumnDefinitions.Add(new ColumnDefinition()
            {
                Width = new GridLength(1, GridUnitType.Star)
            });
            this.RowDefinitions.Add(new RowDefinition()
            {
                Height = new GridLength(1, GridUnitType.Star)
            });

            object tmp;

            this.editorAdapter = EditorControlService.CreateEditor(out tmp);

            this.editor = (AvalonEdit.TextEditor)tmp;
            this.editor.SetValue(Grid.ColumnProperty, 0);
            this.editor.SetValue(Grid.RowProperty, 0);
            this.editor.ShowLineNumbers = false;

            if (consoleOptions == null)
            {
                consoleOptions = new TextEditorOptions(editor.Options);
                consoleOptions.AllowScrollBelowDocument = false;
            }

            this.editor.Options = consoleOptions;

            this.Children.Add(editor);

            editor.TextArea.ReadOnlySectionProvider = readOnlyRegion = new BeginReadOnlySectionProvider();

            editor.TextArea.TextEntered    += new TextCompositionEventHandler(editor_TextArea_TextEntered);
            editor.TextArea.PreviewKeyDown += new KeyEventHandler(editor_TextArea_PreviewKeyDown);
        }
		public ScriptingConsoleTextEditor(TextEditor textEditor)
		{
			this.textEditor = textEditor;
			readOnlyRegion = new BeginReadOnlySectionProvider();
			textEditor.TextArea.ReadOnlySectionProvider = readOnlyRegion;
			textEditor.PreviewKeyDown += OnTextEditorPreviewKeyDown;
		}
		public ConsoleControl()
		{
			this.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
			this.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(1, GridUnitType.Star) });
			
			object tmp;
			
			this.editorAdapter = EditorControlService.CreateEditor(out tmp);
			
			this.editor = (AvalonEdit.TextEditor)tmp;
			this.editor.SetValue(Grid.ColumnProperty, 0);
			this.editor.SetValue(Grid.RowProperty, 0);
			this.editor.ShowLineNumbers = false;
			
			this.Children.Add(editor);
			
			editor.TextArea.ReadOnlySectionProvider = readOnlyRegion = new BeginReadOnlySectionProvider();
			
			editor.TextArea.TextEntered += new TextCompositionEventHandler(editor_TextArea_TextEntered);
			editor.TextArea.PreviewKeyDown += new KeyEventHandler(editor_TextArea_PreviewKeyDown);
		}