예제 #1
0
        public override void initialize()
        {
            var site  = new DownloadNodesSample.HtmlSample("http://" + Site);
            var image = site.FindImage(Keyword);

            if (image != null && image != "BRAK SZUKANEGO OBRAZKA")
            {
                string body = "<html><body><br/><br/><img src=" + image +
                              " /></body></html></body></html>";
                string subject = "Twój obrazek z " + Site;
                if (this.emailAdress != null)
                {
                    var email = new Email(emailAdress, subject, body);
                    email.SendEmail();
                }
                else
                {
                    var window = new PopOut(image, subject);
                    window.initialize();
                }
            }
        }
예제 #2
0
        public override void initialize()
        {
            Json json = new Json(City);

            string subject = "Twój obrazek z pogoda";

            if (Convert.ToDecimal(json.temperature) >= Temperature)
            {
                if (emailAdress != null && emailAdress.Length > 2)
                {
                    string body = "<html><body><p>" + json.description + "</p><br/><br/><img src=" + json.image +
                                  " /></body></html></body></html>";
                    var email = new Email(emailAdress, subject, body);
                    email.SendEmail();
                }
                else
                {
                    var window = new PopOut(json.image, json.description);
                    window.initialize();
                }
            }
        }