Exemple #1
0
        public void ExecuteQuest()
        {
            if (ConditionType == "Slowo")
            {
                UpdateImagePath();
                if (JpgPath != "")
                {
                    if (TaskType == "Wyślij e-mailem")
                    {
                        SendMail("Obrazek na dziś!", "Obrazek na dziś!");
                    }
                    else if (TaskType == "Wyświetl obraz")
                    {
                        ShowImage();
                    }
                }
            }
            else if (ConditionType == "Pogoda")
            {
                if (TaskType == "Wyślij e-mailem")
                {
                    Wmgr = new WeatherManager(City);
                    if (TypeTempHeight == "wyższa niż" && Wmgr.weatherInfo.Main.Temp > Convert.ToDouble(TempHeight) || TypeTempHeight == "niższa niż" && Wmgr.weatherInfo.Main.Temp < Convert.ToDouble(TempHeight))
                    {
                        string weather = $"Temperatura wynosi dzisiaj {Wmgr.weatherInfo.Main.Temp - 273} st. Celcjusza. Ciśnienie {Wmgr.weatherInfo.Main.Pressure} hPa.";

                        SendMail("Pogoda na dziś!", weather);
                        Console.WriteLine(City);
                    }
                }
                else if (TaskType == "Wyświetl obraz")
                {
                    Form_Weather form = new Form_Weather(City);
                    form.ShowDialog();
                }
            }
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Form_Weather form = new Form_Weather();

            form.ShowDialog();
        }