Exemple #1
0
 void apnClientAuthProcess_AuthSuccess(object sender, AppNetDotNet.AuthorizationWindow.AuthEventArgs e)
 {
     if (e != null)
     {
         if (e.success)
         {
             account.accessToken = e.accessToken;
             if (account.verifyCredentials())
             {
                 Properties.Settings.Default.accessToken = account.accessToken;
                 openMainWindow();
                 return;
             }
             else
             {
                 MessageBox.Show(":(", "Authorization failed");
             }
         }
         else
         {
             MessageBox.Show(e.error, "Authorization failed");
         }
         AppNetDotNet.Model.Authorization.clientSideFlow apnClientAuthProcess = new AppNetDotNet.Model.Authorization.clientSideFlow(ApiKeys.appNetClientID, ApiKeys.appNetRedirectUri, "basic stream write_post follow messages");
         apnClientAuthProcess.AuthSuccess += apnClientAuthProcess_AuthSuccess;
         apnClientAuthProcess.showAuthWindow();
     }
 }
 void apnClientAuthProcess_AuthSuccess(object sender, AppNetDotNet.AuthorizationWindow.AuthEventArgs e)
 {
     if (e != null)
     {
         if (e.success)
         {
             access_token = e.accessToken;
             check_access_token();
         }
     }
 }
 void auth_window_AuthSuccess(object sender, AppNetDotNet.AuthorizationWindow.AuthEventArgs e)
 {
     if (e.success)
     {
         Model.Account account = new Model.Account();
         account.access_token = e.accessToken;
         Tuple <AppNetDotNet.Model.Token, AppNetDotNet.ApiCalls.ApiCallResponse> token_response = AppNetDotNet.ApiCalls.Tokens.get(account.access_token);
         if (token_response.Item2.success)
         {
             account.token = token_response.Item1;
             accounts.Add(account);
             return;
         }
         else
         {
             account = null;
         }
     }
 }
 static void apnAuthProcess_AuthSuccess(object sender, AppNetDotNet.AuthorizationWindow.AuthEventArgs e)
 {
     if (e != null)
     {
         if (e.success)
         {
             AccountAppDotNet account = new AccountAppDotNet();
             account.accessToken = e.accessToken;
             if (account.verifyCredentials())
             {
                 AppController.Current.AllAccounts.Add(account);
                 account.UpdateItems();
             }
             else
             {
                 System.Windows.MessageBox.Show(":(", "Authorization failed");
             }
         }
         else
         {
             System.Windows.MessageBox.Show(e.error, "Authorization failed");
         }
     }
 }