Beispiel #1
0
        static void MainLoop(CancellationToken token)
        {
            while (true)
            {
                // do something here.
                var email = new TurdMail();
                var tweet = new TurdTweet();
                //var
                email.CheckMail();
                if (email.Notification)
                {
                    //do a tweet
                    tweet.DoTweet(email);
                }

                Thread.Sleep(1000 * 5);

                // Poll on this property if you have to do
                // other cleanup before throwing.

                if (token.IsCancellationRequested)
                {
                    // Clean up here, then...
                    //"cleanup".Dump();
                    token.ThrowIfCancellationRequested();
                }
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var email = new TurdMail();
            var tweet = new TurdTweet();

            //var
            email.CheckMail();
            if (email.Notification)
            {
                //do a tweet
                tweet.DoTweet(email);
            }
        }
Beispiel #3
0
 public bool DoTweet(TurdMail turdMail)
 {
     System.Console.WriteLine("poo found at {0} at {1}", turdMail.Location, turdMail.Time);
     return(true);
 }