public DocumentForm NewDocument() { DocumentForm doc = new DocumentForm(); SetScintillaToCurrentOptions(doc); doc.Title = String.Format(CultureInfo.CurrentCulture, "{0}{1}", NEW_DOCUMENT_TEXT, ++_newDocumentCount); ((MainWindow)System.Windows.Application.Current.MainWindow).documentsRoot.Children.Add(doc); doc.DockAsDocument(); doc.IsActive = true; return(doc); }
public DocumentForm OpenFile(string filePath) { DocumentForm doc = new DocumentForm(); doc.Scintilla.Text = File.ReadAllText(filePath); SetScintillaToCurrentOptions(doc); //doc.Scintilla.UndoRedo.EmptyUndoBuffer(); //doc.Scintilla.Modified = false; doc.Title = Path.GetFileName(filePath); doc.FilePath = filePath; ((MainWindow)System.Windows.Application.Current.MainWindow).documentsRoot.Children.Add(doc); doc.DockAsDocument(); doc.IsActive = true; //incrementalSearcher.Scintilla = doc.Scintilla; return(doc); }