private async void btnAzureContext_Click(object sender, EventArgs e)
        {
            if (_AzureContext == null)
            {
                throw new ArgumentException("Azure Context not set.  You must initiate the AzureLoginContextViewer control with the Bind Method.");
            }

            if (_ChangeType == AzureLoginChangeType.NewOrExistingContext)
            {
                if (_ExistingContext == null)
                {
                    AzureLoginContextDialog azureLoginContextDialog = new AzureLoginContextDialog();
                    await azureLoginContextDialog.InitializeDialog(_AzureContext, _AzureEnvironments, _UserDefinedAzureEnvironments);

                    azureLoginContextDialog.ShowDialog();
                    azureLoginContextDialog.Dispose();
                }
                else
                {
                    AzureNewOrExistingLoginContextDialog azureLoginContextDialog = new AzureNewOrExistingLoginContextDialog();
                    await azureLoginContextDialog.InitializeDialog(this, _AzureEnvironments, _UserDefinedAzureEnvironments);

                    azureLoginContextDialog.ShowDialog();
                    azureLoginContextDialog.Dispose();
                }
            }
            else if (_ChangeType == AzureLoginChangeType.NewContext)
            {
                AzureLoginContextDialog azureLoginContextDialog = new AzureLoginContextDialog();
                await azureLoginContextDialog.InitializeDialog(_AzureContext, _AzureEnvironments, _UserDefinedAzureEnvironments);

                azureLoginContextDialog.ShowDialog();
                azureLoginContextDialog.Dispose();
            }
            else
            {
                AzureSubscriptionContextDialog azureSubscriptionContextDialog = new AzureSubscriptionContextDialog();
                await azureSubscriptionContextDialog.InitializeDialog(_AzureContext);

                azureSubscriptionContextDialog.ShowDialog();
                azureSubscriptionContextDialog.Dispose();
            }

            AfterContextChanged?.Invoke(this);
        }
示例#2
0
 private void treeViewSourceResourceManager1_AfterContextChanged(UserControl sender)
 {
     AfterContextChanged?.Invoke(sender);
 }
示例#3
0
 private async Task AzureLoginContextViewerSource_AfterContextChanged(AzureLoginContextViewer sender)
 {
     AfterContextChanged?.Invoke(this);
 }