public UIViewController GetAuthenticateUI() { return Twitter.GetAuthenticateUI (acc => { _account = acc; IsAuthenticated = true; AccountStore.Create().Save(acc, "Twitter"); OnAuthenricationComplete(); }); }
public void AddNewAccount(Account actNewAccount) { m_aclAccounts.Add(actNewAccount); Save(); actNewAccount.Connect(); }
public void Reset(Action<bool> done) { Logout(delegate(bool didLogOut) { if (IsolatedStorageSettings.ApplicationSettings.Contains(kTwitterCredential)) { IsolatedStorageSettings.ApplicationSettings.Remove(kTwitterCredential); IsolatedStorageSettings.ApplicationSettings.Save(); } instance = new Account(); done(didLogOut); }); }
void RemoveTwitterAccount(Account account, string username) { lock (m_TwitterAccounts) { if (m_TwitterAccounts.ContainsKey(username)) { var handler = m_TwitterAccounts[username]; if (handler.Accounts.Contains(account)) { handler.Accounts.Remove(account); } if (handler.Accounts.Count == 0) { handler.Dispose(); m_TwitterAccounts.Remove(username); var shoutService = ServiceManager.Get<ShoutService>(); shoutService.RemoveHandler(handler); } } } }
void HandleAccountRemoved(Account account) { string username = account.GetProperty("Twitter.Username"); if (!String.IsNullOrEmpty(username)) { RemoveTwitterAccount(account, username); } }
void HandleAccountAdded(Account account) { if (!String.IsNullOrEmpty(account.GetProperty("Twitter.Username")) && !String.IsNullOrEmpty(account.GetProperty("Twitter.Password"))) { string username = account.GetProperty("Twitter.Username"); string password = account.GetProperty("Twitter.Password"); account.GetFeature<UserWebIdentities>().SetIdentity("twitter", username); AddTwitterAccount(account, username, password); } }
void AddTwitterAccount(Account account, string username, string password) { lock (m_TwitterAccounts) { if (!m_TwitterAccounts.ContainsKey(username)) { var handler = new TwitterAccountHandler(username, password); m_TwitterAccounts.Add(username, handler); var shoutService = ServiceManager.Get<ShoutService>(); shoutService.AddHandler(handler); handler.Accounts.Add(account); Console.WriteLine("Added twitter account: " + username); } else if (m_TwitterAccounts[username].Accounts.Contains(account)) { m_TwitterAccounts[username].Password = password; m_TwitterAccounts[username].Accounts.Add(account); } } }
public void AccountConfigUpdated(Account account, string oldUsername, string newUsername, string newPassword) { lock (m_TwitterAccounts) { if (oldUsername != newUsername) { RemoveTwitterAccount(account, oldUsername); } if (!String.IsNullOrEmpty(newUsername) && !String.IsNullOrEmpty(newPassword)) { AddTwitterAccount(account, newUsername, newPassword); } } }
private void m_aclAccounts_AccountAdded(object sender, Account actSubject) { actSubject.UserStream.Receive += new API.Streaming.UserStream.ReceiveHandler(Account_UserStream_Receive); }
private void m_aclAccounts_UserObjectReceived(object sender, Account actSubject) { AsyncContentManager.GetManager().RequestImage(actSubject.UserObject["profile_image_url"].ToString(), AccountGetAvatarCallback, actSubject); }