Пример #1
0
        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);
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
 void IDropable.Drop(object data, DropLocation location)
 {
     DocumentLoader.Load(((string[])data).First());
 }