Beispiel #1
0
 public bool send_now(Account account)
 {
     if (account != null)
     {
         return account.send_post(text);
     }
     return false;
 }
 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;
         }
     }
 }
 private void load_stored_accounts()
 {
     string[] delimiter = { "|||" };
     if (!string.IsNullOrEmpty(Properties.Settings.Default.access_tokens))
     {
         string[] access_tokens = Crypto.ToInsecureString(Crypto.DecryptString(Properties.Settings.Default.access_tokens)).Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
         if (access_tokens.Length > 0)
         {
             foreach (string access_token in access_tokens)
             {
                 Model.Account account = new Model.Account();
                 account.access_token = access_token;
                 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);
                 }
             }
         }
     }
 }
Beispiel #4
0
 private void load_stored_accounts()
 {
     string[] delimiter = { "|||" };
     if (!string.IsNullOrEmpty(Properties.Settings.Default.access_tokens))
     {
         string[] access_tokens = Crypto.ToInsecureString(Crypto.DecryptString(Properties.Settings.Default.access_tokens)).Split(delimiter, StringSplitOptions.RemoveEmptyEntries);
         if (access_tokens.Length > 0)
         {
             foreach (string access_token in access_tokens)
             {
                 Model.Account account = new Model.Account();
                 account.access_token = access_token;
                 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);
                 }
             }
         }
     }
 }
Beispiel #5
0
 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;
         }
     }
 }