Пример #1
0
        /// <summary>
        ///     Creates an analysis naming view model
        /// </summary>
        /// <param name="configuration"></param>
        public AnalysisNamingViewModel(AnalysisConfig configuration)
        {
            m_configuration = configuration;

            var command = new BrowseFolderCommand(command_FolderSelected);
            BrowseCommand = command;
        }
        public AnalysisDatasetSelectionViewModel(MultiAlignAnalysis analysis)
        {
            m_inputFileFilter = "Input Files (*.txt)| *.txt| All Files (*.*)|*.*";
            m_featureFileFilter = DatasetFilterFactory.BuildFileFilters(InputFileType.Features);
            m_openFileDialog = new OpenFileDialog {Filter = m_inputFileFilter};
            m_analysis = analysis;
            ShouldSearchSubDirectories = SearchOption.TopDirectoryOnly;

            // Create The Dataset View Model for Binding
            Datasets = new ObservableCollection<DatasetInformationViewModel>();
            foreach (var information in analysis.MetaData.Datasets)
            {
                var info = new DatasetInformationViewModel(information);
                info.Selected += info_Selected;
                Datasets.Add(info);
            }

            // Route the events here...
            AddFolderCommand = new BaseCommand(AddFolderDelegate, BaseCommand.AlwaysPass);
            AddInputFileCommand = new BaseCommand(AddInputFileDelegate, BaseCommand.AlwaysPass);
            AddSingleFileCommand = new BaseCommand(AddSingleFileDelegate, BaseCommand.AlwaysPass);

            BrowseSingleFileCommand = new BaseCommand(BrowseSingleFile, BaseCommand.AlwaysPass);
            BrowseInputFileCommand = new BaseCommand(BrowseInput, BaseCommand.AlwaysPass);
            BrowseDataFolderCommand = new BrowseFolderCommand(x => { DataFolderPath = x; });

            RemoveSelectedCommand = new BaseCommand(RemoveSelected, BaseCommand.AlwaysPass);
            SelectAllCommand = new BaseCommand(SelectAllDelegate, BaseCommand.AlwaysPass);
            SelectNoneCommand = new BaseCommand(SelectNoneDelegate, BaseCommand.AlwaysPass);

            SelectedDatasets = new ObservableCollection<DatasetInformationViewModel>();
        }
        public DatasetCollectionViewModel(IEnumerable<DatasetInformation> datasets)
        {
            var datasetViewModels = (from dataset in datasets
                select new DatasetInformationViewModel(dataset)).ToList();
            m_models = datasetViewModels;
            Datasets = new ObservableCollection<DatasetInformationViewModel>(datasetViewModels);
            FilteredDatasets = new ObservableCollection<DatasetInformationViewModel>(datasetViewModels);

            Action<string> action = ReconcilePaths;
            var command = new BrowseFolderCommand(action);
            ReconcilePathsCommand = command;
        }