private ProgressStepDefinition[] CreateWorkflowSteps(IProgressController controller)
{
StepAttributes IndeterminateNonCancellableUIStep = StepAttributes.Indeterminate | StepAttributes.NonCancellable;
StepAttributes HiddenIndeterminateNonImpactingNonCancellableUIStep = IndeterminateNonCancellableUIStep | StepAttributes.Hidden | StepAttributes.NoProgressImpact;
StepAttributes HiddenNonImpactingBackgroundStep = StepAttributes.BackgroundThread | StepAttributes.Hidden | StepAttributes.NoProgressImpact;
return new ProgressStepDefinition[]
{
new ProgressStepDefinition(null, HiddenNonImpactingBackgroundStep,
(token, notifications) => notifications.ProgressChanged(Strings.StartedSolutionBindingWorkflow)),
new ProgressStepDefinition(null, StepAttributes.Indeterminate | StepAttributes.Hidden,
(token, notifications) => this.PromptSaveSolutionIfDirty(controller, token)),
new ProgressStepDefinition(Strings.BindingProjectsDisplayMessage, StepAttributes.Indeterminate,
(token, notifications) => this.DiscoverProjects(controller, notifications)),
new ProgressStepDefinition(Strings.BindingProjectsDisplayMessage, StepAttributes.BackgroundThread,
(token, notifications) => this.DownloadQualityProfile(controller, token, notifications, this.GetBindingLanguages())),
new ProgressStepDefinition(null, HiddenIndeterminateNonImpactingNonCancellableUIStep,
(token, notifications) => { NuGetHelper.LoadService(this.host); /*The service needs to be loaded on UI thread*/ }),
new ProgressStepDefinition(Strings.BindingProjectsDisplayMessage, StepAttributes.BackgroundThread,
(token, notifications) => this.InstallPackages(controller, token, notifications)),
new ProgressStepDefinition(Strings.BindingProjectsDisplayMessage, IndeterminateNonCancellableUIStep,
(token, notifications) => this.InitializeSolutionBindingOnUIThread(notifications)),
new ProgressStepDefinition(Strings.BindingProjectsDisplayMessage, StepAttributes.BackgroundThread | StepAttributes.Indeterminate,
(token, notifications) => this.PrepareSolutionBinding(token)),
new ProgressStepDefinition(null, StepAttributes.Hidden | StepAttributes.Indeterminate,
(token, notifications) => this.FinishSolutionBindingOnUIThread(controller, token)),
new ProgressStepDefinition(null, HiddenIndeterminateNonImpactingNonCancellableUIStep,
(token, notifications) => this.SilentSaveSolutionIfDirty()),
new ProgressStepDefinition(null, HiddenNonImpactingBackgroundStep,
(token, notifications) => this.EmitBindingCompleteMessage(notifications))
};
}