예제 #1
0
        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);
        }
예제 #2
0
        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;
        }