protected override void OnNext()
        {
            if (CurrentStep == 0)
            {
                UpdateCanGoForward(false);

                SafeThreading.JoinableTaskFactory.Run(async() =>
                {
                    await SafeThreading.JoinableTaskFactory.SwitchToMainThreadAsync();
                    var output = await CleanupAndGenerateNewItemAsync();
                    if (output.HasChangesToApply)
                    {
                        base.OnNext();
                        await EnsureCodeViewerInitializedAsync();
                        WizardStatus.HasOverlayBox     = false;
                        NewItemSetup.EditionVisibility = Visibility.Collapsed;
                        SetChangesSummaryTitle();
                        NavigationService.Navigate(new ChangesSummaryView(output));
                    }
                    else
                    {
                        UpdateCanGoForward(true);
                        WizardStatus.SetStatus(StatusViewModel.Warning(string.Format(StringRes.NewItemHasNoChanges, NewItemSetup.ItemName, GetLocalizedTemplateTypeName(ConfigTemplateType).ToLower()), true, 5));
                    }
                });
            }
        }
        public static T CreateK2Object <T>(string name, string registeredWizardName, WizardStatus wizardStatus) where T : SourceCode.Workflow.Authoring.K2Object, IWizardConfigurable
        {
            T obj = CreateK2Object <T>(name);

            obj.WizardDefinition = CreateWizardDefinition(registeredWizardName, wizardStatus);
            return(obj);
        }
        public static T CreateWizardDefinition <T>(string registeredWizardName, WizardStatus wizardStatus) where T : WizardDefinition
        {
            T wizardDefinition = Activator.CreateInstance <T>();

            wizardDefinition.Status = wizardStatus;

            WizardElement registeredWizard = ConfigurationManager.Wizards[registeredWizardName];

            wizardDefinition.RegisteredItem = registeredWizard;

            PopulatePropertyWizards(wizardDefinition);

            return(wizardDefinition);
        }
 public static T CreateEvent <T>(string name, string registeredWizardName, WizardStatus wizardStatus) where T : SourceCode.Workflow.Authoring.Event
 {
     return(CreateK2Object <T>(name, registeredWizardName, wizardStatus));
 }
        public static WizardDefinition CreateWizardDefinition(string registeredWizardName, WizardStatus wizardStatus)
        {
            WizardElement registeredWizard = ConfigurationManager.Wizards[registeredWizardName];

            IWizard          wizardInstance   = (IWizard)registeredWizard.CreateInstance();
            WizardDefinition wizardDefinition = wizardInstance.Definition;

            wizardDefinition.Status = wizardStatus;
            if (wizardInstance is IDisposable)
            {
                (wizardInstance as IDisposable).Dispose();
            }
            return(wizardDefinition);
        }