示例#1
0
        private async void SearchDms()
        {
            var dmsLookupViewModel = new DmsLookupViewModel {
                OutputDirectory = this.outputDirectory
            };
            var dialog = new DmsLookupView {
                DataContext = dmsLookupViewModel
            };

            dmsLookupViewModel.DatasetSelected += (o, e) => dialog.Close();

            dialog.ShowDialog();
            if (!dmsLookupViewModel.Status)
            {
                return;
            }

            if (dmsLookupViewModel.ShouldCopyFiles)
            {
                this.InputFilePath = dmsLookupViewModel.OutputDirectory;
                this.AddFolderCommand.Execute(null);
            }
            else
            {
                foreach (var dataset in dmsLookupViewModel.Datasets)
                {
                    var filePaths = dataset.GetAvailableFiles();
                    if (filePaths.Count > 0)
                    {
                        await this.AddDatasets(filePaths);
                    }
                }
            }
        }
示例#2
0
        /// <summary>
        /// Open a dialog to search for a file on DMS.
        /// </summary>
        /// <param name="dmsLookupViewModel">The view model for the dialog.</param>
        /// <returns>The name of the data set and the name of the job selected.</returns>
        public Tuple <string, string> OpenDmsLookup(DmsLookupViewModel dmsLookupViewModel)
        {
            var dmsLookupDialog = new DmsLookupView {
                DataContext = dmsLookupViewModel
            };

            dmsLookupViewModel.ReadyToClose += (o, e) => dmsLookupDialog.Close();
            dmsLookupDialog.ShowDialog();
            Tuple <string, string> data = null;

            if (dmsLookupViewModel.Status)
            {
                var dataSetFolderPath = (dmsLookupViewModel.SelectedDataset == null) ? string.Empty :
                                        dmsLookupViewModel.SelectedDataset.DatasetFolderPath;
                var jobFolderPath = (dmsLookupViewModel.SelectedJob == null) ? string.Empty :
                                    dmsLookupViewModel.SelectedJob.JobFolderPath;
                data = new Tuple <string, string>(dataSetFolderPath, jobFolderPath);
            }

            return(data);
        }
示例#3
0
        private void SearchDms()
        {
            var dmsLookupViewModel = new DmsLookupViewModel { OutputDirectory = this.outputDirectory };
            var dialog = new DmsLookupView { DataContext = dmsLookupViewModel };
            dmsLookupViewModel.DatasetSelected += (o, e) => dialog.Close();
            dialog.ShowDialog();
            if (!dmsLookupViewModel.Status)
            {
                return;
            }

            if (dmsLookupViewModel.ShouldCopyFiles)
            {
                this.InputFilePath = dmsLookupViewModel.OutputDirectory;
                this.AddFolderCommand.Execute(null);
            }
            else
            {
                var filePaths = dmsLookupViewModel.SelectedDataset.GetAvailableFiles();
                if (filePaths.Count > 0)
                {
                    this.AddDatasets(this.GetInputFilesFromPath(filePaths));
                }
            }
        }