private static void ShowOAuthErrorDialog(OAuthException ex) { Debug.WriteLine($"Failed to fetch oauth credentials: {ex.Message}"); UserPromptUtils.OkPrompt( String.Format(Resources.CloudExplorerGceFailedToGetOauthCredentialsMessage, CredentialsStore.Default.CurrentAccount.AccountName), Resources.CloudExplorerGceFailedToGetOauthCredentialsCaption); }
/// <summary> /// Return a list of projects. Returns empty list if no item is found. /// </summary> private async Task <IList <Project> > GetProjectsAsync() { ResourceManagerDataSource resourceManager = DataSourceFactories.CreateResourceManagerDataSource(); if (resourceManager == null) { return(new List <Project>()); } IsReady = false; try { var projects = await resourceManager.GetSortedActiveProjectsAsync(); if (!projects.Any()) { UserPromptUtils.OkPrompt( message: Resources.CsrNoProjectMessage, title: Resources.CsrConnectSectionTitle); } return(projects); } finally { IsReady = true; } }
/// <summary> /// Starts the attaching remote debugger wizard. /// </summary> /// <param name="gceInstance">A GCE windows VM <seealso cref="Instance"/> object.</param> public static void PromptUser(Instance gceInstance) { if (String.IsNullOrWhiteSpace(gceInstance.GetPublicIpAddress())) { UserPromptUtils.OkPrompt( message: StringResources.AttachDebuggerAddPublicIpAddressMessage, title: StringResources.UiDefaultPromptTitle); return; } var dialog = new AttachDebuggerWindow(gceInstance); EventsReporterWrapper.ReportEvent(RemoteDebuggerWindowOpenEvent.Create()); dialog.ShowModal(); }
public void TestOkPrompt_PromptsWithTitle() { UserPromptWindow userPrompt = GetWindow(() => _objectUnderTest.OkPrompt(DefaultPrompt, ExpectedTitle)); Assert.AreEqual(ExpectedTitle, userPrompt.Title); }