private void TransformSelectedProcessConfigurations(object argument)
        {
            var processConfigurationsToTransform = this.SelectedProcessConfigurations.ToList();
            var dialog = new WorkItemConfigurationItemTransformationEditorDialog(processConfigurationsToTransform, "Process Configuration");

            dialog.Owner = Application.Current.MainWindow;
            if (dialog.ShowDialog() == true)
            {
                var options = dialog.Options;
                var result  = MessageBoxResult.Yes;
                if (!options.HasFlag(ImportOptions.Simulate))
                {
                    result = MessageBox.Show("This will import the transformed process configurations. Are you sure you want to continue?", "Confirm Import", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                }
                if (result == MessageBoxResult.Yes)
                {
                    var teamProjectsWithProcessConfigurations = processConfigurationsToTransform.GroupBy(w => w.TeamProject).ToDictionary(g => g.Key, g => g.Select(w => w.Item).ToList());
                    PerformImport(teamProjectsWithProcessConfigurations, options);
                }
            }
        }
Example #2
0
        private void TransformSelectedWorkItemTypes(object argument)
        {
            var workItemTypesToTransform = this.SelectedWorkItemTypes.ToList();
            var dialog = new WorkItemConfigurationItemTransformationEditorDialog(workItemTypesToTransform.Select(w => new WorkItemConfigurationItemExport(w.TeamProject, w.WorkItemTypeDefinition)).ToList(), "Work Item Type");

            dialog.Owner = Application.Current.MainWindow;
            if (dialog.ShowDialog() == true)
            {
                var options = dialog.Options;
                var result  = MessageBoxResult.Yes;
                if (!options.HasFlag(ImportOptions.Simulate))
                {
                    result = MessageBox.Show("This will import the transformed work item types. Are you sure you want to continue?", "Confirm Import", MessageBoxButton.YesNo, MessageBoxImage.Warning);
                }
                if (result == MessageBoxResult.Yes)
                {
                    var teamProjectsWithWorkItemTypes = workItemTypesToTransform.GroupBy(w => w.TeamProject).ToDictionary(g => g.Key, g => g.Select(w => (WorkItemConfigurationItem)w.WorkItemTypeDefinition).ToList());
                    PerformImport(options, teamProjectsWithWorkItemTypes);
                }
            }
        }