private async void migAzMigrationSourceSelection1_AfterMigrationSourceSelected(UserControl migrationSourceUserControl) { if (migrationSourceUserControl.GetType() == typeof(MigrationAzureSourceContext)) { MigrationAzureSourceContext azureControl = (MigrationAzureSourceContext)migrationSourceUserControl; // This will move to be based on the source context (upon instantiation) azureControl.Bind(this._AzureRetriever, this._statusProvider, this._logProvider, this._appSettingsProvider.GetTargetSettings(), this.imageList1, app.Default.LoginPromptBehavior, this._AzureEnvironments, ref this._UserDefinedAzureEnvironments); azureControl.AzureContext.AzureEnvironment = GetDefaultAzureEnvironment(); azureControl.AzureEnvironmentChanged += MigrationSourceControl_AzureEnvironmentChanged; azureControl.UserAuthenticated += MigrationSourceControl_UserAuthenticated; azureControl.BeforeAzureSubscriptionChange += MigrationSourceControl_BeforeAzureSubscriptionChange; azureControl.AfterAzureSubscriptionChange += MigrationSourceControl_AfterAzureSubscriptionChange; azureControl.BeforeUserSignOut += MigrationSourceControl_BeforeUserSignOut; azureControl.AfterUserSignOut += MigrationSourceControl_AfterUserSignOut; azureControl.AfterAzureTenantChange += MigrationSourceControl_AfterAzureTenantChange; azureControl.BeforeAzureTenantChange += MigrationSourceControl_BeforeAzureTenantChange; azureControl.AfterNodeChecked += MigrationSourceControl_AfterNodeChecked; azureControl.AfterNodeUnchecked += MigrationSourceControl_AfterNodeUnchecked; azureControl.AfterNodeChanged += MigrationSourceControl_AfterNodeChanged; azureControl.ClearContext += MigrationSourceControl_ClearContext; azureControl.AfterContextChanged += AzureControl_AfterContextChanged; azureControl.AzureContext.AzureRetriever.OnRestResult += AzureRetriever_OnRestResult; } MigrationSourceSelectionControlVisible = false; splitContainer3.Panel1.Controls.Add(migrationSourceUserControl); migrationSourceUserControl.Top = 5; migrationSourceUserControl.Left = 5; splitContainer3_Panel1_Resize(this, null); }
private async void AzureControl_AfterContextChanged(UserControl sender) { IMigrationSourceUserControl migrationSourceUserControl = (IMigrationSourceUserControl)sender; targetAzureContextViewer.Enabled = migrationSourceUserControl.IsSourceContextAuthenticated; if (migrationSourceUserControl != null && migrationSourceUserControl.GetType() == typeof(MigrationAzureSourceContext)) { MigrationAzureSourceContext azureSourceContext = (MigrationAzureSourceContext)migrationSourceUserControl; targetAzureContextViewer.ExistingContext = azureSourceContext.AzureContext; } }
private void optionsToolStripMenuItem_Click(object sender, EventArgs e) { OptionsDialog optionsDialog = new OptionsDialog(); optionsDialog.Bind(_AzureEnvironments, _UserDefinedAzureEnvironments); optionsDialog.ShowDialog(); IMigrationSourceUserControl sourceUserControl = this.MigrationSourceControl; if (sourceUserControl != null) { if (sourceUserControl.GetType() == typeof(MigrationAzureSourceContext)) { MigrationAzureSourceContext migrationAzureSourceContext = (MigrationAzureSourceContext)sourceUserControl; migrationAzureSourceContext.AzureContext.LoginPromptBehavior = app.Default.LoginPromptBehavior; } } }