/// <summary>
        /// Returns the active TwitterAuthInfo object; if nothing is active then a new TwitterAuthInfo object is returned
        /// </summary>
        /// <returns></returns>
        public static TwitterAuthInfo TwitterGetActiveAcct()
        {
            TwitterAuthInfo acc = new TwitterAuthInfo();

            if (CheckTwitterAccounts())
            {
                acc = Engine.conf.TwitterAccountsList[Engine.conf.TwitterAcctSelected];
            }
            return(acc);
        }
 public static TwitterAuthInfo TwitterAuthSetPin(ref TwitterAuthInfo acc)
 {
     try
     {
         if (null != acc)
         {
             oAuthTwitter oAuth = new oAuthTwitter(Engine.TWITTER_CONSUMER_KEY, Engine.TWITTER_CONSUMER_SECRET);
             acc = oAuth.AccessTokenGet(ref acc);
         }
     }
     catch (Exception ex)
     {
         FileSystem.AppendDebug("Error while setting Twitter PIN", ex);
     }
     return(acc);
 }
        public static TwitterAuthInfo TwitterAuthGetPin()
        {
            // authorize ZScreen to twitter
            oAuthTwitter    oAuth    = new oAuthTwitter(Engine.TWITTER_CONSUMER_KEY, Engine.TWITTER_CONSUMER_SECRET);
            TwitterAuthInfo acc      = TwitterGetActiveAcct();
            string          authLink = oAuth.AuthorizationLinkGet();

            if (!string.IsNullOrEmpty(acc.AccountName))
            {
                oAuth.AuthInfo.AccountName = acc.AccountName;
            }
            if (CheckTwitterAccounts())
            {
                Engine.conf.TwitterAccountsList[Engine.conf.TwitterAcctSelected] = oAuth.AuthInfo;
            }
            if (!string.IsNullOrEmpty(authLink))
            {
                System.Diagnostics.Process.Start(authLink);
            }
            return(oAuth.AuthInfo);
        }
        public static void TwitterMsg(string url)
        {
            TwitterAuthInfo acc = TwitterGetActiveAcct();

            if (!string.IsNullOrEmpty(acc.TokenSecret))
            {
                List <oAuthTwitter> oAccList = new List <oAuthTwitter>();
                foreach (TwitterAuthInfo oAuth in Engine.conf.TwitterAccountsList)
                {
                    oAccList.Add(new oAuthTwitter(Engine.TWITTER_CONSUMER_KEY, Engine.TWITTER_CONSUMER_SECRET, oAuth)
                    {
                        Enabled = acc.AccountName == oAuth.AccountName
                    });
                }
                TwitterMsg msg = new TwitterMsg(oAccList, string.Format("{0} - Update Twitter Status...", acc.AccountName));
                msg.ActiveAccountName = acc.AccountName;
                msg.Icon          = Resources.zss_main;
                msg.Config        = Engine.conf.TwitterClientConfig;
                msg.FormClosed   += new FormClosedEventHandler(twitterClient_FormClosed);
                msg.txtTweet.Text = url;
                msg.Show();
            }
        }