示例#1
0
 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.");
     }
 }
示例#2
0
 public void LoadFile(DocumentReference docRef)
 {
     this.docRef  = docRef;
     this.Content = File.ReadAllText(docRef.Name);
     this.Title   = docRef.Name;
 }