Beispiel #1
0
        void ImporterUIFinished(object sender, EventArgs e)
        {
            ((IImporterUI <IBilingualDictionary>)sender).Finished -= new EventHandler(this.ImporterUIFinished);

            if (select.SelectedItem != null && select.SelectedItem is ImporterItem)
            {
                if (CurrentUI is IImporterUI <IBilingualDictionary> )
                {
                    ((IImporterUI <IBilingualDictionary>)CurrentUI).Apply();
                }
                CurrentUI = null;

                Controls.ProgressUI progressUI = new Controls.ProgressUI();
                CurrentUI = progressUI;

                importer.BeginImport();
            }
        }
Beispiel #2
0
        private void ImporterUIFinished(object sender, EventArgs e)
        {
            ((IImporterUI <WordList>)sender).Finished -= ImporterUIFinished;

            if (importerSelection.SelectedItem is ImporterItem)
            {
                var importerUI = CurrentUI as IImporterUI <WordList>;
                if (importerUI != null)
                {
                    importerUI.Apply();
                }
                CurrentUI = null;

                var progressUI = new Controls.ProgressUI();
                CurrentUI = progressUI;

                // Try is needed here too in case the import fails synchronously.
                try {
                    importer.BeginImport();
                } catch (ImportException ex) {
                    ImportFailed(ex);
                }
            }
        }