Esempio n. 1
0
        public TimelineStatus(Status stFrom, BasicAPI bAPI)
        {
            InitializeComponent();

            m_bAPI = bAPI;
            m_bDisplayConversationButton = false;
            m_fntScreenNameFont          = new Font("Arial", 10);
            m_fntRetweetedFont           = new Font("Arial", 8);
            m_fntFromUser = new Font("Arial", 10, FontStyle.Bold);
            m_sbFromUser  = new SolidBrush(Color.Black);
            m_sbRetweet   = new SolidBrush(Color.FromArgb(70, 70, 70));
            m_pnBorderPen = new Pen(Color.FromArgb(220, 220, 220));

            m_stStatusObj = stFrom;
            ttfTextField.UpdateFromStatus(m_stStatusObj);
            Favorite = Boolean.Parse(m_stStatusObj["favorited"].ToString());

            if (m_stStatusObj.IsRetweet)
            {
                if (m_stStatusObj.RetweetedStatus == null)
                {
                    if ((m_stStatusObj.StatusText.Words.Count > 1) && (m_stStatusObj.StatusText.Words[1].Type == StatusTextElement.StatusTextElementType.ScreenName))
                    {
                        m_sFromUser = m_stStatusObj.StatusText.Words[1].Text.Substring(1);
                        new Thread(new ThreadStart(UserLookup)).Start();
                    }
                }
                else
                {
                    m_sFromUser = m_stStatusObj.RetweetedStatus.User["screen_name"].ToString();
                    AsyncContentManager.GetManager().RequestImage(m_stStatusObj.RetweetedStatus.User["profile_image_url"].ToString(), AvatarCallback);
                }
            }
            else
            {
                m_sFromUser = m_stStatusObj.User["screen_name"].ToString();
                AsyncContentManager.GetManager().RequestImage(m_stStatusObj.User["profile_image_url"].ToString(), AvatarCallback);
            }

            User uActiveUser = TwitterController.GetController().ActiveAccount.UserObject;

            if (uActiveUser != null)
            {
                Retweet = m_stStatusObj.IsRetweet && (m_sFromUser == TwitterController.GetController().ActiveAccount.UserObject["screen_name"].ToString());
            }

            ttfTextField.TextElementClicked += new TweetTextField.TextElementClickHandler(ttfTextField_TextElementClicked);

            abRetweet.Click      += new EventHandler(abRetweet_Click);
            abFavorite.Click     += new EventHandler(abFavorite_Click);
            abReply.Click        += new EventHandler(abReply_Click);
            abConversation.Click += new EventHandler(abConversation_Click);
        }