Beispiel #1
0
        /// <summary>
        /// Initializes a new instance
        /// </summary>
        public XmlTextEditorControl()
        {
            XmlFormattingStrategy strategy = new XmlFormattingStrategy();

            Document.FormattingStrategy             = (IFormattingStrategy)strategy;
            Document.HighlightingStrategy           = HighlightingManager.Manager.FindHighlighter("XML");
            Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();
        }
		public XmlEditorControl() {
				XmlFormattingStrategy strategy = new XmlFormattingStrategy();
			Document.FormattingStrategy = strategy;

			Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("XML");
			Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();
			TextEditorProperties = new SharpDevelopTextEditorProperties();

		}
        public XmlEditorControl()
        {
            XmlFormattingStrategy strategy = new XmlFormattingStrategy();
            Document.FormattingStrategy = (IFormattingStrategy)strategy;

            Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("XML");
            Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();

            Document.BookmarkManager.Factory = new SDBookmarkFactory(Document.BookmarkManager);
            Document.BookmarkManager.Added   += new ICSharpCode.TextEditor.Document.BookmarkEventHandler(BookmarkAdded);
            Document.BookmarkManager.Removed += new ICSharpCode.TextEditor.Document.BookmarkEventHandler(BookmarkRemoved);
        }
        public void Init()
        {
            formattingStrategy = new XmlFormattingStrategy();

            options            = new MockTextEditorOptions();
            textEditor         = new MockTextEditor();
            textEditor.Options = options;

            textDocument = new TextDocument();
            document     = textDocument;
            textEditor.SetDocument(document);
        }
Beispiel #5
0
        public void Init()
        {
            formattingStrategy = new XmlFormattingStrategy();

            options            = new MockTextEditorOptions();
            textEditor         = new MockTextEditor();
            textEditor.Options = options;

            textDocument = new TextDocument();
            document     = new AvalonEditDocumentAdapter(textDocument, null);
            textEditor.SetDocument(document);
        }
Beispiel #6
0
        public XMLDoc()
        {
            InitializeComponent();

            SetTextEditorDefaultProperties();
            XmlFormattingStrategy strategy = new XmlFormattingStrategy();
            XmlFoldingStrategy    folding  = new XmlFoldingStrategy();

            txtEditCtl.Document.FormattingStrategy             = (IFormattingStrategy)strategy;
            txtEditCtl.Document.HighlightingStrategy           = HighlightingManager.Manager.FindHighlighter("XML");
            txtEditCtl.Document.FoldingManager.FoldingStrategy = (IFoldingStrategy)folding;

            WireEvents();
            backgroundWorker1.DoWork             += new DoWorkEventHandler(backgroundWorker1_DoWork);
            backgroundWorker1.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorker1_RunWorkerCompleted);
        }
		public XmlEditorControl()
		{
            validationTimer = new Timer();
            validationTimer.Interval = 1500;
            validationTimer.Enabled = true;
            validationTimer.Tick += new EventHandler(validationTimer_Tick);
			XmlFormattingStrategy strategy = new XmlFormattingStrategy();
			Document.FormattingStrategy = (IFormattingStrategy)strategy;
			
			Document.HighlightingStrategy = HighlightingManager.Manager.FindHighlighter("XML");
			Document.FoldingManager.FoldingStrategy = new XmlFoldingStrategy();
			
			//Document.BookmarkManager.Factory = new SDBookmarkFactory(Document.BookmarkManager);
			Document.BookmarkManager.Added   += new ICSharpCode.TextEditor.Document.BookmarkEventHandler(BookmarkAdded);
			Document.BookmarkManager.Removed += new ICSharpCode.TextEditor.Document.BookmarkEventHandler(BookmarkRemoved);
            Document.DocumentChanged += new DocumentEventHandler(Document_DocumentChanged);
		}
        public void Init()
        {
            formattingStrategy = new XmlFormattingStrategy();

            options            = new MockTextEditorOptions();
            textEditor         = new MockTextEditor();
            textEditor.Options = options;

            textDocument = new TextDocument();
            document     = textDocument;
            textEditor.SetDocument(document);

            document.Text =
                "<root>\r\n" +
                "\t<child>\r\n" +
                "</root>\r\n";

            // Just typed the '>' character of the <child> element
            textEditor.Caret.Offset = 16;
            formattingStrategy.FormatLine(textEditor, '>');
        }
Beispiel #9
0
        public XmlEditor()
            : base()
        {
            InitializeComponent();

            SyntaxHighlighting = ICSharpCode.AvalonEdit.Highlighting.HighlightingManager.Instance.GetDefinition("XML");
            ShowLineNumbers    = true;

            WeakEventManager <ICSharpCode.AvalonEdit.Editing.TextArea, TextCompositionEventArgs>
            .AddHandler(TextArea, "TextEntering", TextArea_TextEntering);

            WeakEventManager <ICSharpCode.AvalonEdit.Editing.TextArea, TextCompositionEventArgs>
            .AddHandler(TextArea, "TextEntered", TextArea_TextEntered);

            WeakEventManager <XmlEditor, EventArgs>
            .AddHandler(this, "DocumentChanged", XmlEditor_DocumentChanged);

            TextArea.DefaultInputHandler.CommandBindings.Add(
                new CommandBinding(CustomCommands.CtrlSpaceCompletion, OnCodeCompletion));

            _formattingStrategy          = new XmlFormattingStrategy();
            TextArea.IndentationStrategy = new IndentationStrategyAdapter(this, _formattingStrategy);

            _textMarkerService = new TextMarkerService(this);
            var textView = TextArea.TextView;

            textView.BackgroundRenderers.Add(_textMarkerService);
            textView.LineTransformers.Add(_textMarkerService);
            textView.Services.AddService(typeof(TextMarkerService), _textMarkerService);

            WeakEventManager <ICSharpCode.AvalonEdit.Rendering.TextView, MouseEventArgs>
            .AddHandler(textView, "MouseHover", MouseHover);

            WeakEventManager <ICSharpCode.AvalonEdit.Rendering.TextView, MouseEventArgs>
            .AddHandler(textView, "MouseHoverStopped", TextEditorMouseHoverStopped);

            WeakEventManager <ICSharpCode.AvalonEdit.Rendering.TextView, EventArgs>
            .AddHandler(textView, "VisualLinesChanged", VisualLinesChanged);
        }
Beispiel #10
0
        public void Init()
        {
            formattingStrategy = new XmlFormattingStrategy();

            options            = new MockTextEditorOptions();
            textEditor         = new MockTextEditor();
            textEditor.Options = options;

            textDocument = new TextDocument();
            document     = new AvalonEditDocumentAdapter(textDocument, null);
            textEditor.SetDocument(document);

            document.Text =
                "<root>\r\n" +
                "\t<child>\r\n" +
                "</child>\r\n" +
                "</root>\r\n";

            docLine            = new MockDocumentLine();
            docLine.LineNumber = 3;
            formattingStrategy.IndentLine(textEditor, docLine);
        }
        public void Init()
        {
            formattingStrategy = new XmlFormattingStrategy();

            options            = new MockTextEditorOptions();
            textEditor         = new MockTextEditor();
            textEditor.Options = options;

            textDocument = new TextDocument();
            document     = textDocument;
            textEditor.SetDocument(document);

            document.Text =
                "<root>\r\n" +
                "\t<child>\r\n" +
                "</child>\r\n" +
                "</root>\r\n";

            docLine = MockRepository.GenerateStub <IDocumentLine>();
            docLine.Stub(l => l.LineNumber).Return(3);
            formattingStrategy.IndentLine(textEditor, docLine);
        }
Beispiel #12
0
        public void Init()
        {
            formattingStrategy = new XmlFormattingStrategy();

            options            = new MockTextEditorOptions();
            textEditor         = new MockTextEditor();
            textEditor.Options = options;

            textDocument = new TextDocument();
            document     = new AvalonEditDocumentAdapter(textDocument, null);
            textEditor.SetDocument(document);

            textDocument.Text =
                "<root>\r\n" +
                "\t<child></child>\r\n" +
                "</root>";

            int selectionStart  = 9;
            int selectionLength = 15;

            textEditor.Select(selectionStart, selectionLength);

            formattingStrategy.SurroundSelectionWithComment(textEditor);
        }