示例#1
0
 /// <summary>
 /// Post hate tweets to text box
 /// </summary>
 /// <param name="tweet"></param>
 private void postTweet(string tweet)
 {
     if (textBox1.InvokeRequired)
     {
         var d = new PostTweetDelegate(postTweet);
         textBox1.Invoke(d, new object[] { tweet });
     }
     else
     {
         textBox1.Text += tweet + Environment.NewLine;
     }
 }
示例#2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            // set delegates to their appropriate method
            ChartingDelegate     chartDel     = new ChartingDelegate(chartData);
            PostTweetDelegate    postTweetDel = new PostTweetDelegate(postTweet);
            ChartingWordDelegate chartWordDel = new ChartingWordDelegate(chartWords);

            //
            cc = new ChartingClass(chartDel, postTweetDel, chartWordDel);

            // only look at recent tweets
            dt = DateTime.Now.ToString("MM/dd/yyyy H:mm:ss");

            // clear all the series in chart 1 and 2
            this.chart1.Series.Clear();
            this.chart2.Series.Clear();

            // Set chart1 palette
            this.chart1.Palette = ChartColorPalette.Light;

            // Set chart titles
            this.chart1.Titles.Add("Hate Tweet Stats");
            this.chart2.Titles.Add("Tweet Word Stats");
        }