public void Init()
		{
			formattingStrategy = new XmlFormattingStrategy();
			
			options = new MockTextEditorOptions();
			textEditor = new MockTextEditor();
			textEditor.Options = options;
			
			textDocument = new TextDocument();
			document = textDocument;
			textEditor.SetDocument(document);
		}
예제 #2
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);
		}
예제 #3
0
        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);
			
			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, '>');
		}
		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);
		}
		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);
			
			textDocument.Text = 
				"<root>\r\n" +
				"\t<child></child>\r\n" +
				"</root>";
			
			int selectionStart = 9;
			int selectionLength = 15;
			textEditor.Select(selectionStart, selectionLength);
			
			formattingStrategy.SurroundSelectionWithComment(textEditor);
		}