private string authoriseTrello(Uri authUrl) { if (settings.ContainsKey(trelloUserTokenSettingName)) { var existingToken = settings[trelloUserTokenSettingName]; settings.Remove(trelloUserTokenSettingName); return(existingToken); } var trelloAuthDialog = new TrelloAuthDialog(); trelloAuthDialog.TwitterAuthUrl.NavigateUri = authUrl; trelloAuthDialog.TwitterAuthUrl.RequestNavigate += (sender, args) => { Process.Start( new ProcessStartInfo(args.Uri.AbsoluteUri)); args.Handled = true; }; string authFromUser = null; trelloAuthDialog.OkButton.Click += (sender, args) => { authFromUser = trelloAuthDialog.TwitterAuthText.Text; trelloAuthDialog.Close(); }; trelloAuthDialog.ShowDialog(); return(authFromUser); }
private string authoriseTrello(Uri authUrl) { if (settings.ContainsKey(trelloUserTokenSettingName)) { var existingToken = settings[trelloUserTokenSettingName]; settings.Remove(trelloUserTokenSettingName); return existingToken; } var trelloAuthDialog = new TrelloAuthDialog(); trelloAuthDialog.TwitterAuthUrl.NavigateUri = authUrl; trelloAuthDialog.TwitterAuthUrl.RequestNavigate += (sender, args) => { Process.Start( new ProcessStartInfo(args.Uri.AbsoluteUri)); args.Handled = true; }; string authFromUser = null; trelloAuthDialog.OkButton.Click += (sender, args) => { authFromUser = trelloAuthDialog.TwitterAuthText.Text; trelloAuthDialog.Close(); }; trelloAuthDialog.ShowDialog(); return authFromUser; }