public void ShowImportReferences() { User.CheckPermission(PermissionCategory.IMPORT_REFERENCES, PERMISSION_MASK.ALLOW, "You do not have sufficient privileges to import references into BioLink!"); if (_importReferencesWizard == null) { var context = new ImportWizardContext(); Func <List <FieldDescriptor> > fieldSource = () => { var service = new ImportService(User); return(service.GetReferenceImportFields()); }; Func <ImportProcessor> importProcessorFactory = () => { return(new ImportReferencesProcessor()); }; _importReferencesWizard = new ImportWizard(User, "Import References", context, new ImportFilterSelection(), new ImportMappingPage(fieldSource), new ImportPage(importProcessorFactory)); _importReferencesWizard.Closed += new EventHandler((sender, e) => { _importReferencesWizard = null; }); } _importReferencesWizard.Show(); _importReferencesWizard.Focus(); }
private void ExecutedMovePrevious(object target, ExecutedRoutedEventArgs e) { ImportWizard wizard = target as ImportWizard; if (target != null) { wizard.MovePreviousPage(); } }
private void ExecutedMoveNext(object target, ExecutedRoutedEventArgs e) { ImportWizard wizard = target as ImportWizard; if (wizard != null) { wizard.MoveNextPage(); } }
public override void Dispose() { base.Dispose(); if (_importWizard != null) { _importWizard.Close(); _importWizard = null; } if (_importReferencesWizard != null) { _importReferencesWizard.Close(); _importWizard = null; } }
private void CanExecuteMovePrevious(object target, CanExecuteRoutedEventArgs e) { ImportWizard wizard = target as ImportWizard; e.CanExecute = false; if (target != null) { var prevPage = wizard.PreviousPage; if (prevPage != null) { if (prevPage.CanMovePrevious()) { e.CanExecute = true; } } } }
private void CanExecuteMoveNext(object target, CanExecuteRoutedEventArgs e) { ImportWizard wizard = target as ImportWizard; e.CanExecute = false; if (target != null) { var nextPage = wizard.NextPage; if (nextPage != null) { if (wizard.CurrentPage.CanMoveNext()) { e.CanExecute = true; } } } }