コード例 #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();
        }