public void ShowDocument(string filename) { try { Document doc = new Document(); DocumentReference docRef = new DocumentReference(doc, filename); doc.LoadFile(docRef); doc.Owner = this.MainWindow; doc.Show(); doc.Activate(); Documents.Add(docRef); } catch { MessageBox.Show("Could not load document."); } }
public void LoadFile(DocumentReference docRef) { this.docRef = docRef; this.Content = File.ReadAllText(docRef.Name); this.Title = docRef.Name; }