public static void AddClient(TwitterCredential twitCred)
        {
            lock (Instances)
            {
                CurrentRevision++;

                TwitterClient twitClient;
                if (!Instances.ContainsKey(twitCred.Id))
                {
                    twitClient = new TwitterClient(twitCred);
                    twitClient.ClientUpdated += ClientStatusUpdatedEvent;

                    Instances.Add(twitCred.Id, twitClient);
                }
                else
                {
                    twitClient = Instances[twitCred.Id];
                    twitClient.Credential.ScreenName = twitCred.ScreenName;
                    twitClient.Credential.Cookie     = twitCred.Cookie;
                }

                ClientStatusUpdatedEvent(twitCred.Id, new StateUpdateData {
                    ScreenName = twitCred.ScreenName
                });

                Config.Save();
            }
        }
        public TwitterClient(TwitterCredential credential)
        {
            this.Credential = credential;

            this.m_tlHome    = new TlHome(this);
            this.m_tlAboutMe = new TlAboutMe(this);
            this.m_tlDm      = new TlDirectMessage(this);
        }
Exemple #3
0
        public static TwitterCredential GetCredential(string cookie)
        {
            var tempCredentials = new TwitterCredential()
            {
                Cookie = cookie,
            };

            if (!tempCredentials.VerifyCredentials())
            {
                return(null);
            }

            return(tempCredentials);
        }