/// <summary>
        /// Extension method used to help format labels that track migration status. Must be executed on the UI Thread.
        /// </summary>
        /// <param name="source">Label to be updated</param>
        /// <param name="status">Status type used for formatting.</param>
        public static void UpdateMigrationStatus(this TextBlock source, MigrationStatusEnum status)
        {
            switch (status)
            {
            case MigrationStatusEnum.Running:
                source.FontWeight = FontWeights.Bold;
                break;

            case MigrationStatusEnum.Passed:
                source.FontWeight = FontWeights.ExtraBold;
                source.Foreground = Brushes.Green;
                break;

            case MigrationStatusEnum.Failed:
                source.FontWeight = FontWeights.ExtraBold;
                source.Foreground = Brushes.Red;
                break;

            default:
                break;
            }
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceProfileResponse" /> class.
 /// </summary>
 /// <param name="id">id.</param>
 /// <param name="name">name.</param>
 /// <param name="metadata">Additional information about the device profile, limited to 10 entries..</param>
 /// <param name="restrictions">restrictions.</param>
 /// <param name="migrationStatus">migrationStatus (required) (default to MigrationStatusEnum.NOTMIGRATED).</param>
 /// <param name="status">status.</param>
 /// <param name="preferences">preferences.</param>
 /// <param name="components">components.</param>
 public DeviceProfileResponse(string id = default(string), string name = default(string), Dictionary <string, string> metadata = default(Dictionary <string, string>), DeviceRestriction restrictions = default(DeviceRestriction), MigrationStatusEnum migrationStatus = MigrationStatusEnum.NOTMIGRATED, DeviceProfileStatus?status = default(DeviceProfileStatus?), List <PreferenceResponse> preferences = default(List <PreferenceResponse>), List <DeviceComponent> components = default(List <DeviceComponent>))
 {
     this.MigrationStatus = migrationStatus;
     this.Id           = id;
     this.Name         = name;
     this.Metadata     = metadata;
     this.Restrictions = restrictions;
     this.Status       = status;
     this.Preferences  = preferences;
     this.Components   = components;
 }
Пример #3
0
        /// <summary>
        /// Informs the user of the status of a target step of the migration process.
        /// </summary>
        /// <param name="step">Step that is getting updated.</param>
        /// <param name="status">The status the step is being changed to.</param>
        public async Task UpdateStepStatusAsync(MigrationStepEnum step, MigrationStatusEnum status)
        {
            //Scheduling the update of the target step in the migration process process.
            //Extension method is used on the TextBlock to update the status of the migration step.
            await Dispatcher.InvokeAsync(() =>
            {
                switch (step)
                {
                case MigrationStepEnum.Startup:
                    BorderStartupProcess.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;
                    TextBlockStartupProcessStatus.UpdateMigrationStatus(status);
                    break;

                case MigrationStepEnum.HttpModules:
                    BorderMigrateHttpModules.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;
                    TextBlockMigrateHttpModulesStatus.UpdateMigrationStatus(status);
                    break;

                case MigrationStepEnum.StaticFiles:
                    BorderMigrateStaticFiles.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;
                    TextBlockMigrateStaticFilesStatus.UpdateMigrationStatus(status);
                    break;

                case MigrationStepEnum.Bundling:
                    BorderMigrateBundling.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;
                    TextBlockMigrateBundlingStatus.UpdateMigrationStatus(status);
                    break;

                case MigrationStepEnum.AspxPages:
                    BorderMigrateAspxPages.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;

                    TextBlockMigrateAspxPagesStatus.UpdateMigrationStatus(status);
                    break;

                case MigrationStepEnum.Config:
                    BorderMigrateConfiguration.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;
                    TextBlockMigrateConfigurationStatus.UpdateMigrationStatus(status);
                    break;

                case MigrationStepEnum.AppLogic:
                    BorderMigrateLogic.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;

                    TextBlockMigrateLogicStatus.UpdateMigrationStatus(status);
                    break;

                case MigrationStepEnum.MigrationProcess:
                    BorderMigrateProcess.Visibility = status == MigrationStatusEnum.Running
                            ? Visibility.Visible
                            : Visibility.Hidden;

                    TextBlockMigrationProcessStatus.UpdateMigrationStatus(status);
                    break;
                }
            }
                                         , DispatcherPriority.Normal);
        }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DeviceProfileMigrationStatus" /> class.
 /// </summary>
 /// <param name="migrationStatus">migrationStatus (required) (default to MigrationStatusEnum.NOTMIGRATED).</param>
 public DeviceProfileMigrationStatus(MigrationStatusEnum migrationStatus = MigrationStatusEnum.NOTMIGRATED)
 {
     this.MigrationStatus = migrationStatus;
 }
Пример #5
0
 public async Task UpdateStepStatusAsync(MigrationStepEnum step, MigrationStatusEnum status)
 {
     throw new NotImplementedException();
 }