Пример #1
0
        internal DocumentView NewDocument()
        {
            DocumentView doc = new DocumentView();

            InitScintillaDocument(doc);
            doc.Title = String.Format(CultureInfo.CurrentCulture, "{0}{1}", ScintillaConstants.NEW_DOCUMENT_TEXT, ++_newDocumentCount);
            documentsRoot.Children.Add(doc);
            doc.DockAsDocument();
            doc.IsActive  = true;
            doc.ContentId = Guid.NewGuid().ToString();
            doc.Closing  += Doc_Closing;
            doc.Title    += " *";
            return(doc);
        }
Пример #2
0
        public DocumentView OpenFile(string filePath)
        {
            DocumentView doc = new DocumentView();

            InitScintillaDocument(doc);
            doc.scintilla.Text = File.ReadAllText(filePath);
            doc.scintilla.EmptyUndoBuffer();
            doc.Title    = System.IO.Path.GetFileName(filePath);
            doc.FilePath = filePath;
            documentsRoot.Children.Add(doc);
            doc.DockAsDocument();
            doc.IsActive  = true;
            doc.ContentId = Guid.NewGuid().ToString();
            doc.Closing  += Doc_Closing;
            RefreshSoltionExplorer();

            return(doc);
        }