Пример #1
0
        //public string SoapAction { get; set; }
        public EditorControl()
        {
            var host = new ElementHost();
              host.Size = new Size(200, 100);
              host.Location = new Point(100, 100);
              host.Dock = DockStyle.Fill;

              _extEditor = new ExtendedEditor();
              var editor = _extEditor.editor;
              editor.FontFamily = new System.Windows.Media.FontFamily("Consolas");
              editor.FontSize = 12.0;
              editor.Options.ConvertTabsToSpaces = true;
              editor.Options.EnableRectangularSelection = true;
              editor.Options.IndentationSize = 2;
              editor.ShowLineNumbers = true;
              editor.SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinitionByExtension(".xml");
              editor.TextArea.TextEntering += TextArea_TextEntering;
              editor.TextArea.TextEntered += TextArea_TextEntered;
              editor.TextArea.KeyDown += TextArea_KeyDown;
              host.Child = _extEditor;

              editor.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.DefaultIndentationStrategy();

              this.Controls.Add(host);
        }
Пример #2
0
        //public string SoapAction { get; set; }

        public EditorControl()
        {
            var host = new ElementHost();

            host.Size     = new Size(200, 100);
            host.Location = new Point(100, 100);
            host.Dock     = DockStyle.Fill;

            _extEditor = new ExtendedEditor();
            var editor = _extEditor.editor;

            editor.FontFamily = new System.Windows.Media.FontFamily("Consolas");
            editor.FontSize   = 12.0;
            editor.Options.ConvertTabsToSpaces        = true;
            editor.Options.EnableRectangularSelection = true;
            editor.Options.IndentationSize            = 2;
            editor.ShowLineNumbers        = true;
            editor.SyntaxHighlighting     = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinitionByExtension(".xml");
            editor.TextArea.TextEntering += TextArea_TextEntering;
            editor.TextArea.TextEntered  += TextArea_TextEntered;
            editor.TextArea.KeyDown      += TextArea_KeyDown;
            host.Child = _extEditor;

            editor.TextArea.IndentationStrategy = new ICSharpCode.AvalonEdit.Indentation.DefaultIndentationStrategy();

            this.Controls.Add(host);
        }