Beispiel #1
0
        public Dialog(User u, Tweet ct)
        {
            InitializeComponent();
            TwitterUser = u;
            CurrentTweet = ct;

            pPicture.Image = TwitterUser.ImageNormal;
            LabelUserName.Text = String.Format("{0} ({1})",
                        TwitterUser.Name,
                        TwitterUser.ScreenName);
        }
Beispiel #2
0
        private void SetTweetItemThisForm(Tweet ti, string lTimeCaption)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new SetTweetItem(SetTweetItemThisForm), new object[] { ti, lTimeCaption });
            }

            TweetItem content_ = new TweetItem(ti);
            content_.lTime.Text = lTimeCaption;
            content_.Dock = DockStyle.Fill;
            this.Controls.Add(content_);
        }
Beispiel #3
0
        private IList<Tweet> FriendsTimeLineParser(string XmlString, Tweet.TweetTypes tip)
        {
            IList<Tweet> TimeLine = new List<Tweet>();

            XmlDocument Xdoc = new XmlDocument();
            XmlNodeList Liste = null;

            Xdoc.LoadXml(XmlString);
            XmlElement Kok = Xdoc.DocumentElement;

            // TimeLine dolu ise.
            if (Kok.SelectSingleNode("/statuses/status") != null)
            {
                Liste = Xdoc.SelectNodes("/statuses/status");

                // Xml Listesi Aktarılıyor.
                for (int i = 0; i < Liste.Count; i++)
                {
                    TimeLine.Add(CreateTweet(Liste[i], tip));
                }
            }

            return TimeLine;
        }
Beispiel #4
0
        private Tweet CreateTweet(XmlNode XmlTweet, Tweet.TweetTypes tip)
        {
            Tweet t = new Tweet();
            t.CreateAt = Utils.TarihVer(XmlTweet.SelectSingleNode("created_at").InnerText);
            t.Id = XmlTweet.SelectSingleNode("id").InnerText;
            t.isRead = false;
            t.isFavorite = bool.Parse(XmlTweet.SelectSingleNode("favorited").InnerText);

            t.ReplyScreenName = XmlTweet.SelectSingleNode("in_reply_to_screen_name").InnerText;
            t.ReplyStatusId = XmlTweet.SelectSingleNode("in_reply_to_status_id").InnerText;
            t.ReplyUserId = XmlTweet.SelectSingleNode("in_reply_to_user_id").InnerText;

            t.TweetType = tip;

            t.Source = GetSourceFromLink(XmlTweet.SelectSingleNode("source").InnerText);
            t.Text = XmlTweet.SelectSingleNode("text").InnerText;

            t.UserId = XmlTweet.SelectSingleNode("user/id").InnerText;
            t.UserName = XmlTweet.SelectSingleNode("user/name").InnerText;
            t.UserScreenName = XmlTweet.SelectSingleNode("user/screen_name").InnerText;
            t.ProfilImageUrl = XmlTweet.SelectSingleNode("user/profile_image_url").InnerText;

            return t;
        }
Beispiel #5
0
        private Tweet CreateMessage(XmlNode XmlTweet)
        {
            Tweet t = new Tweet();
            t.CreateAt = Utils.TarihVer(XmlTweet.SelectSingleNode("created_at").InnerText);
            t.Id = XmlTweet.SelectSingleNode("id").InnerText;
            t.isRead = false;
            t.TweetType = Tweet.TweetTypes.Message;

            t.Text = XmlTweet.SelectSingleNode("text").InnerText;

            t.UserId = XmlTweet.SelectSingleNode("sender/id").InnerText;
            t.UserName = XmlTweet.SelectSingleNode("sender/name").InnerText;
            t.UserScreenName = XmlTweet.SelectSingleNode("sender/screen_name").InnerText;
            t.ProfilImageUrl = XmlTweet.SelectSingleNode("sender/profile_image_url").InnerText;

            return t;
        }
Beispiel #6
0
 public void SetSinceId(Tweet t)
 {
     switch (t.TweetType)
     {
         case Tweet.TweetTypes.Normal:
             Regedit.SetKey_("since_recent", t.Id);
             break;
         case Tweet.TweetTypes.Reply:
             Regedit.SetKey_("since_reply", t.Id);
             break;
         case Tweet.TweetTypes.Message:
             Regedit.SetKey_("since_message", t.Id);
             break;
         default:
             break;
     }
 }
Beispiel #7
0
 private void RefreshReadItem(Tweet.TweetTypes tip)
 {
     switch (tip)
     {
         case Tweet.TweetTypes.Normal:
             SetTweetNumber(tsRecents, GetUnreadItem(FriendsTimeLine));
             break;
         case Tweet.TweetTypes.Reply:
             SetTweetNumber(tsReplys, GetUnreadItem(RepliesTimeLine));
             break;
         case Tweet.TweetTypes.Message:
             SetTweetNumber(tsMessages, GetUnreadItem(MessagesTimeLine));
             break;
         case Tweet.TweetTypes.Deleted:
             break;
         default:
             break;
     }
 }
Beispiel #8
0
        private void OpenNoticeForm(Tweet t)
        {
            if (InvokeRequired)
            {
                BeginInvoke(new del_OpenNoticeForm(OpenNoticeForm), new object[] { t});
                return;
            }

            string lTimeCaption = String.Format(dil_.GetString("ITEM_MENU_8", cInfo_),
                ToRelativeDate(t.CreateAt),
                t.Source);

            Notification n = new Notification(t, lTimeCaption);

            ShowWindow(n.Handle, SW_SHOWNOACTIVATE);
            SetWindowPos(n.Handle.ToInt32(), HWND_TOPMOST,
            (Screen.PrimaryScreen.WorkingArea.Width - n.Width)-5,
            (Screen.PrimaryScreen.WorkingArea.Height - n.Height) - NoticePadding,
            n.Width, n.Height,
            SWP_NOACTIVATE);

            NoticePadding += 64;
        }
Beispiel #9
0
        private void AddNewTweetInList(IList<TweetItem> tList_, 
            Tweet.TweetTypes tip)
        {
            NoticePadding = 0;
            string ShotNoticeStr_ = Regedit.GetKey_("check_notice");
            bool ShowNotice = String.IsNullOrEmpty(ShotNoticeStr_) ? true :
                bool.Parse(ShotNoticeStr_);

            IList<TweetItem> tList = tList_;

            lock (this)
            {
                if (tList != null)
                {
                    foreach (TweetItem item in tList)
                    {
                        if (item != null)
                        {
                            // Olaylar yükleniyor
                            AddEventsTweetItem(item);

                            switch (tip)
                            {
                                case Tweet.TweetTypes.Normal:

                                    if(FriendsTimeLine != null)
                                        FriendsTimeLine.Insert(0, item);

                                    break;
                                case Tweet.TweetTypes.Reply:

                                    if(RepliesTimeLine != null)
                                        RepliesTimeLine.Insert(0, item);

                                    break;
                                case Tweet.TweetTypes.Message:

                                    if(MessagesTimeLine != null)
                                        MessagesTimeLine.Insert(0, item);

                                    break;
                                default:
                                    break;
                            }

                            // Show Notice
                            if (ShowNotice)
                            {
                                OpenNoticeForm(item.ItemTweet);
                            }
                        }
                    }
                }
            }
        }
Beispiel #10
0
 public Notification(Tweet t, string lTimeCaption)
 {
     InitializeComponent();
     SetTweetItemThisForm(t, lTimeCaption);
 }
Beispiel #11
0
        public void SetBackColorDefault(Tweet.TweetTypes tp)
        {
            this.TweetText.ForeColor = Color.Gray;
            this.TweetText.LinkColor = Color.RoyalBlue;
            this.FullName.ForeColor = Color.Gray;
            this.lTime.ForeColor = Color.Gray;

            switch (tp)
            {
                case TogiApi.Tweet.TweetTypes.Normal:
                    this.BackColor = Color.PaleTurquoise;
                    break;

                case TogiApi.Tweet.TweetTypes.Message:
                    this.BackColor = Color.Wheat;
                    break;

                case TogiApi.Tweet.TweetTypes.Reply:
                    this.BackColor = Color.FromArgb(195, 238, 190);
                    break;

                case TogiApi.Tweet.TweetTypes.Deleted:
                    this.BackColor = Color.WhiteSmoke;
                    break;

                default:
                    break;
            }
        }
Beispiel #12
0
 public TweetItem(Tweet t)
 {
     InitializeComponent();
     ItemTweet = t;
 }
Beispiel #13
0
        public void SetBackColorIsRead(Tweet.TweetTypes tp)
        {
            this.TweetText.ForeColor = Color.Black;
            this.TweetText.LinkColor = Color.RoyalBlue;
            this.FullName.ForeColor = Color.Black;
            this.lTime.ForeColor = Color.Black;

            switch (tp)
            {
                case TogiApi.Tweet.TweetTypes.Normal:
                    this.BackColor = Color.FromArgb(115, 229, 229);
                    break;

                case TogiApi.Tweet.TweetTypes.Message:
                    this.BackColor = Color.Orange;
                    break;

                case TogiApi.Tweet.TweetTypes.Reply:
                    this.BackColor = Color.FromArgb(171, 229, 113);
                    break;

                case TogiApi.Tweet.TweetTypes.Deleted:
                    this.BackColor = Color.WhiteSmoke;
                    break;

                default:
                    break;
            }
        }