Esempio n. 1
0
 private void FormDeck_Resize(object sender, EventArgs e)
 {
     // resize column heights accordingly
     for (int i = 0; i < flowColumns.Controls.Count; i++)
     {
         ColumnControl cc = (ColumnControl)flowColumns.Controls[i];
         cc.Height = flowColumns.Height - 3;
     }
 }
Esempio n. 2
0
 public void InsertDMIn(TwitterDirectMessage dm, ColumnType colType)
 {
     for (int i = 0; i < flowColumns.Controls.Count; i++)
     {
         ColumnControl cc = (ColumnControl)flowColumns.Controls[i];
         if (cc.ColType == colType)
         {
             cc.InsertDM(cc.flowColumn, dm);
         }
     }
 }
Esempio n. 3
0
 public void InsertTweetIn(TwitterStatus tweet, ColumnType colType)
 {
     for (int i = 0; i < flowColumns.Controls.Count; i++)
     {
         ColumnControl cc = (ColumnControl)flowColumns.Controls[i];
         if (cc.ColType == colType)
         {
             cc.InsertTweet(cc.flowColumn, tweet);
         }
     }
 }
Esempio n. 4
0
        /// <summary>
        /// Set "columns" settings in Global.Settings, you HAVE to call Global.Settings.Save() after!!
        /// </summary>
        public void SetSettingsColumns()
        {
            string strColumns = "";

            for (int i = 0; i < flowColumns.Controls.Count; i++)
            {
                ColumnControl cc            = (ColumnControl)flowColumns.Controls[i];
                string        strColumnType = cc.ColType.ToString();
                string        strColumnMeta = cc.ListLocation;
                strColumns += strColumnType + ":" + strColumnMeta + ",";
            }
            Global.Settings.SetString("columns", strColumns.Trim(','));
        }
Esempio n. 5
0
        private void FormDeck_Load(object sender, EventArgs e)
        {
            UpdateMediaGroupBoxes();

              bool bFirstStart = !Global.Settings.GetBool("started");
              int iWidth = Global.Settings.GetInt("deck_width");
              int iHeight = Global.Settings.GetInt("deck_height");
              int iLeft = Global.Settings.GetInt("deck_left");
              int iTop = Global.Settings.GetInt("deck_top");

              if (iWidth != 0 && iHeight != 0) {
            this.Width = iWidth;
            this.Height = iHeight;
            this.Left = iLeft;
            this.Top = iTop;
              }

              // on first startup
              if (bFirstStart) {
            // add some predefined columns
            ColumnControl ccTimeline = new ColumnControl();
            ccTimeline.SetColumnType(ColumnType.Timeline, "");
            flowColumns.Controls.Add(ccTimeline);

            ColumnControl ccMentions = new ColumnControl();
            ccMentions.SetColumnType(ColumnType.Mentions, "");
            flowColumns.Controls.Add(ccMentions);

            ColumnControl ccDirectMessages = new ColumnControl();
            ccDirectMessages.SetColumnType(ColumnType.DirectMessages, "");
            flowColumns.Controls.Add(ccDirectMessages);

            Global.Settings.SetBool("started", true);
            SetSettingsColumns();
            Global.Settings.Save();
              } else {
            // load columns from config
            string[] astrColumns = Global.Settings.GetString("columns").Split(',');
            for (int i = 0; i < astrColumns.Length; i++) {
              string[] astrColumnInfo = astrColumns[i].Split(':');

              string strColumnType = astrColumnInfo[0];
              string strColumnMeta = astrColumnInfo[1];

              ColumnControl cc = new ColumnControl();
              cc.SetColumnType(strColumnType, strColumnMeta);
              flowColumns.Controls.Add(cc);
              cc.Height = flowColumns.Height - 3;
            }
              }

              if (Global.ThisUser != null) {
            Global.DownloadImageToPictureBox(picUserAvatar, Global.ThisUser.ProfileImageSecureLocation, this);
            labelUserName.Text = "@" + Global.ThisUser.ScreenName;

            // load initial tweets for all columns
            for (int i = 0; i < flowColumns.Controls.Count; i++) {
              ColumnControl cc = (ColumnControl)flowColumns.Controls[i];
              cc.DownloadInitialTweets();
            }
              }

              StartStreaming();
        }
Esempio n. 6
0
        private void FormDeck_Load(object sender, EventArgs e)
        {
            UpdateMediaGroupBoxes();

            bool bFirstStart = !Global.Settings.GetBool("started");
            int  iWidth      = Global.Settings.GetInt("deck_width");
            int  iHeight     = Global.Settings.GetInt("deck_height");
            int  iLeft       = Global.Settings.GetInt("deck_left");
            int  iTop        = Global.Settings.GetInt("deck_top");

            if (iWidth != 0 && iHeight != 0)
            {
                this.Width  = iWidth;
                this.Height = iHeight;
                this.Left   = iLeft;
                this.Top    = iTop;
            }

            // on first startup
            if (bFirstStart)
            {
                // add some predefined columns
                ColumnControl ccTimeline = new ColumnControl();
                ccTimeline.SetColumnType(ColumnType.Timeline, "");
                flowColumns.Controls.Add(ccTimeline);

                ColumnControl ccMentions = new ColumnControl();
                ccMentions.SetColumnType(ColumnType.Mentions, "");
                flowColumns.Controls.Add(ccMentions);

                ColumnControl ccDirectMessages = new ColumnControl();
                ccDirectMessages.SetColumnType(ColumnType.DirectMessages, "");
                flowColumns.Controls.Add(ccDirectMessages);

                Global.Settings.SetBool("started", true);
                SetSettingsColumns();
                Global.Settings.Save();
            }
            else
            {
                // load columns from config
                string[] astrColumns = Global.Settings.GetString("columns").Split(',');
                for (int i = 0; i < astrColumns.Length; i++)
                {
                    string[] astrColumnInfo = astrColumns[i].Split(':');

                    string strColumnType = astrColumnInfo[0];
                    string strColumnMeta = astrColumnInfo[1];

                    ColumnControl cc = new ColumnControl();
                    cc.SetColumnType(strColumnType, strColumnMeta);
                    flowColumns.Controls.Add(cc);
                    cc.Height = flowColumns.Height - 3;
                }
            }

            if (Global.ThisUser != null)
            {
                Global.DownloadImageToPictureBox(picUserAvatar, Global.ThisUser.ProfileImageSecureLocation, this);
                labelUserName.Text = "@" + Global.ThisUser.ScreenName;

                // load initial tweets for all columns
                for (int i = 0; i < flowColumns.Controls.Count; i++)
                {
                    ColumnControl cc = (ColumnControl)flowColumns.Controls[i];
                    cc.DownloadInitialTweets();
                }
            }

            StartStreaming();
        }