Esempio n. 1
0
        private ICommandExecution CreateWhenTargetIsFolder(ICombineToMakeCommand cmd, CatalogueFolder targetCatalogueFolder)
        {
            var sourceCatalogue      = cmd as CatalogueCombineable;
            var sourceManyCatalogues = cmd as ManyCataloguesCombineable;
            var file = cmd as FileCollectionCombineable;

            if (sourceCatalogue != null)
            {
                return(new ExecuteCommandPutCatalogueIntoCatalogueFolder(_activator, sourceCatalogue, targetCatalogueFolder));
            }

            if (sourceManyCatalogues != null)
            {
                return(new ExecuteCommandPutCatalogueIntoCatalogueFolder(_activator, sourceManyCatalogues, targetCatalogueFolder));
            }

            if (file != null)
            {
                if (file.Files.Length == 1)
                {
                    var toReturn = new ExecuteCommandCreateNewCatalogueByImportingFile(_activator, file.Files[0]);
                    toReturn.TargetFolder = targetCatalogueFolder;
                    return(toReturn);
                }
            }

            return(null);
        }
        public CreateNewCatalogueByImportingFileUI(IActivateItems activator, ExecuteCommandCreateNewCatalogueByImportingFile command) : base(activator)
        {
            _command = command;
            InitializeComponent();

            pbFile.Image = activator.CoreIconProvider.GetImage(RDMPConcept.File);
            serverDatabaseTableSelector1.HideTableComponents();
            serverDatabaseTableSelector1.SelectionChanged += serverDatabaseTableSelector1_SelectionChanged;
            SetupState(State.SelectFile);

            if (command.File != null)
            {
                SelectFile(command.File);
            }

            pbHelp.Image = FamFamFamIcons.help;

            BuildHelpFlow();
        }