Beispiel #1
0
        /// <summary>
        /// Migration Wizard Part listens to the Wizard Action's Notifications.
        /// This is handler for those notifications
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void WizardAction_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            // If Notification is of Migration of a singleWorkitem
            if (e.PropertyName == MigrateWorkItemsAction.Passed ||
                e.PropertyName == MigrateWorkItemsAction.Failed ||
                e.PropertyName == MigrateWorkItemsAction.Warning)
            {
                // Then update teh counters
                UpdateCounters(e.PropertyName);
            }
            // else if Wizard Action state is changed and it is changed to either Success/Warning/Failed
            else if (String.CompareOrdinal(e.PropertyName, "State") == 0 &&
                     (CurrentAction.State == WizardActionState.Success ||
                      CurrentAction.State == WizardActionState.Failed ||
                      CurrentAction.State == WizardActionState.Stopped ||
                      CurrentAction.State == WizardActionState.Warning))
            {
                // then Update Status of MigrationPart(Counters/Flags etc)
                UpdateStatus(CurrentAction.State);

                CurrentAction.Dispose();

                // Change current Action to next action in queue
                m_currentWizardActionNumber++;
                NotifyPropertyChanged("IsMigrating");

                // If there is any action pending then start it else update the Migration Part's satte and update its description
                if (m_currentWizardActionNumber < WizardActions.Count)
                {
                    CurrentAction.Start();
                }
                else
                {
                    UpdateWizardActionState();
                    switch (MigrationState)
                    {
                    case WizardActionState.Success:

                        Description = Resources.MigrationSuccessfulText;
                        break;

                    case WizardActionState.Warning:
                        Description = "Work items were migrated successfully but with warnings.";
                        break;

                    case WizardActionState.Failed:
                        Description = "Some error occured during migration of work items.";
                        break;

                    default:
                        break;
                    }
                }
            }
        }