Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        private void ExecutedMovePrevious(object target, ExecutedRoutedEventArgs e)
        {
            ImportWizard wizard = target as ImportWizard;

            if (target != null)
            {
                wizard.MovePreviousPage();
            }
        }
Exemplo n.º 3
0
        private void ExecutedMoveNext(object target, ExecutedRoutedEventArgs e)
        {
            ImportWizard wizard = target as ImportWizard;

            if (wizard != null)
            {
                wizard.MoveNextPage();
            }
        }
Exemplo n.º 4
0
        public override void Dispose()
        {
            base.Dispose();

            if (_importWizard != null)
            {
                _importWizard.Close();
                _importWizard = null;
            }

            if (_importReferencesWizard != null)
            {
                _importReferencesWizard.Close();
                _importWizard = null;
            }
        }
Exemplo n.º 5
0
        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;
                    }
                }
            }
        }
Exemplo n.º 6
0
        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;
                    }
                }
            }
        }