예제 #1
0
        private void YandexLogInButton(object sender, RoutedEventArgs e)
        {
            if (String.IsNullOrEmpty(Properties.Settings.Default.SettingsKey))
            {
                var login = new YandexLogin("638293295dc6456fafa73726be67b68b", "8bc1b5dc48c34d97bc6d14de150113de", true);
                login.ShowDialog();

                if (login.IsSuccessfully)
                {
                    Properties.Settings.Default.SettingsKey = login.AccessTokenValue;
                    MessageBox.Show("Вход выполнен успешно!");
                }
                else
                {
                    MessageBox.Show("ERROR");
                }
            }
        }
예제 #2
0
        private void GetAccessToken()
        {
            var login = new YandexLogin("80bbde206ef74606bf239039bce82ed0", "123c7a7a69614d18a5d5e23397009bac", this.AlwaysNewToken);

            login.Owner = this;
            login.ShowDialog();

            if (login.IsSuccessfully)
            {
                Properties.Settings.Default.AccessToken = login.AccessToken.Value;
                Properties.Settings.Default.Save();

                this.Authorization = new HttpAuthorization(AuthorizationType.OAuth, Properties.Settings.Default.AccessToken);
                this.GetFiles();
            }
            else
            {
                MessageBox.Show("error...");
            }
        }