private void OpenDocumentFromFile() { var dialog = new OpenFileDialog { DefaultExt = ".ged", Filter = "GlyphEdit Document (*.ged)|*.ged|All files (*.*)|*.*", FilterIndex = 0 }; if (dialog.ShowDialog(App.Current.MainWindow) == true) { var document = DocumentLoader.Load(dialog.FileName); OpenDocument(document, dialog.FileName); } }
private void OpenDocument(ViewerState state) { var file = string.IsNullOrEmpty(Aux) ? Tag : Aux; // Follow the link. if (!File.Exists(file)) { return; } using (var fs = File.Open(file, FileMode.Open)) { var document = DocumentLoader.Load(fs, file); state.LoadDocument(document, true); } }
void IDropable.Drop(object data, DropLocation location) { DocumentLoader.Load(((string[])data).First()); }