Exemple #1
0
        /// <summary>
        /// Creates a new document and loads the given file
        /// </summary>
        public IDocument CreateFromTextBuffer(ITextBufferStrategy textBuffer)
        {
            DefaultDocument doc = (DefaultDocument)CreateDocument();

            doc.TextContent        = textBuffer.GetText(0, textBuffer.Length);
            doc.TextBufferStrategy = textBuffer;
            return(doc);
        }
Exemple #2
0
        public IDocument CreateFromTextBuffer(ITextBufferStrategy textBuffer)
        {
            DefaultDocument text = (DefaultDocument)this.CreateDocument();

            text.TextContent        = textBuffer.GetText(0, textBuffer.Length);
            text.TextBufferStrategy = textBuffer;
            return(text);
        }
 /// <summary>
 /// Creates a new instance of <see cref="DefaultSelection"/>
 /// </summary>
 public DefaultSelection(IDocument document, TextLocation startPosition, TextLocation endPosition)
 {
     DefaultDocument.ValidatePosition(document, startPosition);
     DefaultDocument.ValidatePosition(document, endPosition);
     Debug.Assert(startPosition <= endPosition);
     this.document      = document;
     this.startPosition = startPosition;
     this.endPosition   = endPosition;
 }
		/// <remarks>
		/// Creates a new <see cref="IDocument"/> object. Only create
		/// <see cref="IDocument"/> with this method.
		/// </remarks>
		public IDocument CreateDocument()
		{
			DefaultDocument doc = new DefaultDocument();
			doc.TextBufferStrategy  = new GapTextBufferStrategy();
			doc.FormattingStrategy  = new DefaultFormattingStrategy();
			doc.LineManager         = new LineManager(doc, null);
			doc.FoldingManager      = new FoldingManager(doc, doc.LineManager);
			doc.FoldingManager.FoldingStrategy       = null; //new ParserFoldingStrategy();
			doc.MarkerStrategy      = new MarkerStrategy(doc);
			doc.BookmarkManager     = new BookmarkManager(doc, doc.LineManager);
			return doc;
		}
        /// <remarks>
        /// Creates a new <see cref="IDocument"/> object. Only create
        /// <see cref="IDocument"/> with this method.
        /// </remarks>
        public IDocument CreateDocument()
        {
            DefaultDocument doc = new DefaultDocument();

            doc.TextBufferStrategy             = new GapTextBufferStrategy();
            doc.FormattingStrategy             = new DefaultFormattingStrategy();
            doc.LineManager                    = new LineManager(doc, null);
            doc.FoldingManager                 = new FoldingManager(doc, doc.LineManager);
            doc.FoldingManager.FoldingStrategy = null;                   //new ParserFoldingStrategy();
            doc.MarkerStrategy                 = new MarkerStrategy(doc);
            doc.BookmarkManager                = new BookmarkManager(doc, doc.LineManager);
            return(doc);
        }
Exemple #6
0
        public IDocument CreateDocument()
        {
            DefaultDocument defaultDocument = new DefaultDocument()
            {
                TextBufferStrategy = new GapTextBufferStrategy(),
                FormattingStrategy = new DefaultFormattingStrategy()
            };

            defaultDocument.LineManager    = new LineManager(defaultDocument, null);
            defaultDocument.FoldingManager = new FoldingManager(defaultDocument, defaultDocument.LineManager)
            {
                FoldingStrategy = null
            };
            defaultDocument.MarkerStrategy  = new MarkerStrategy(defaultDocument);
            defaultDocument.BookmarkManager = new BookmarkManager(defaultDocument, defaultDocument.LineManager);
            return(defaultDocument);
        }