Ejemplo n.º 1
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            ZX.BeginAnimation(OpacityProperty, new DoubleAnimation(0.3, 1, TimeSpan.FromSeconds(1))
            {
                AutoReverse = true
            });
            if (await Lemon_Updata.IsLemonNew(He.KMS))
            {
                new UpdataWindow().Show();
            }
            if (!Uuuhh.Lalala("www.mi.com"))
            {
                ZX.Background = MIN.Background;
            }
            else
            {
                ZX.Background = MAX.Background;
            }
            if (System.IO.File.Exists(AppDomain.CurrentDomain.BaseDirectory + "UserImage.bmp"))
            {
                tx.Background = new ImageBrush(new BitmapImage(new Uri(AppDomain.CurrentDomain.BaseDirectory + "UserImage.bmp", UriKind.Absolute)));
            }
            DateTime tmCur = DateTime.Now;

            if (tmCur.Hour > 18 && tmCur.Hour < 24)
            {
                Toast.SetToastNotion("晚上好:", "欢迎回来" + Settings.Default.RobotName, "------早睡早起身体好").Show();
            }
            else if (tmCur.Hour >= 11 && tmCur.Hour < 12)
            {
                Toast.SetToastNotion("中午好:", "欢迎回来" + Settings.Default.RobotName, "------中午啦~吃饭饭了~~").Show();
            }
            else if (tmCur.Hour > 1 && tmCur.Hour < 5)
            {
                Toast.SetToastNotion("凌晨好:", "欢迎回来" + Settings.Default.RobotName, "-----不乖哦,还没有睡觉~").Show();
            }
            else if (tmCur.Hour > 6 && tmCur.Hour < 11)
            {
                Toast.SetToastNotion("早上好:", "欢迎回来" + Settings.Default.RobotName, "-----一日之计在于晨,早上是最宝贵的时间哦~").Show();
            }
            else if (tmCur.Hour > 13 && tmCur.Hour < 17)
            {
                Toast.SetToastNotion("下午好:", "欢迎回来" + Settings.Default.RobotName, "------祝你今天好运!").Show();
            }
            LemonWeather w = new LemonWeather(Settings.Default.WeatherInfo);

            Toast.SetToastNotion($"今日{w.WeatherName}天气", w.WeatherMessage, "-----来自柠檬天气Toast").Show();
        }
Ejemplo n.º 2
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            while (this.Top > EndTop)
            {
                this.Top -= 5;
            }
            Welcome.Inlines.Clear();
            Weather.Inlines.Clear();
            DateTime tmCur = DateTime.Now;

            if (tmCur.Hour >= 18 && tmCur.Hour <= 24)
            {
                b.Background = new ImageBrush(new BitmapImage(new Uri("http://i9.download.fd.pchome.net/t_960x600/g1/M00/10/15/ooYBAFWoU_mIZ8UZAAL0iXuHXcgAACmNwIIMlcAAvSh377.jpg")));
                Welcome.Inlines.Add(new Run($"晚上好呀!"));
                Welcome.Inlines.Add(new LineBreak());
                Welcome.Inlines.Add(new Run("早睡早起身体好")
                {
                    FontSize = 14
                });
            }
            else if (tmCur.Hour >= 11 && tmCur.Hour <= 12)
            {
                b.Background = new ImageBrush(new BitmapImage(new Uri("http://i9.download.fd.pchome.net/t_960x600/g1/M00/10/15/ooYBAFWoU_mIZ8UZAAL0iXuHXcgAACmNwIIMlcAAvSh377.jpg")));
                Welcome.Inlines.Add(new Run($"午安!"));
                Welcome.Inlines.Add(new LineBreak());
                Welcome.Inlines.Add(new Run("中午啦~吃饭饭惹~")
                {
                    FontSize = 14
                });
            }
            else if (tmCur.Hour >= 1 && tmCur.Hour <= 5)
            {
                b.Background = new ImageBrush(new BitmapImage(new Uri("http://img.kutoo8.com//upload/thumb/012066/f36a5eff700ba80a626fe54eb1bce043_320x480.jpg")));
                Welcome.Inlines.Add(new Run($"凌晨好呀!"));
                Welcome.Inlines.Add(new LineBreak());
                Welcome.Inlines.Add(new Run("不乖哦~还没有睡觉惹~")
                {
                    FontSize = 14
                });
            }
            else if (tmCur.Hour >= 6 && tmCur.Hour <= 11)
            {
                b.Background = new ImageBrush(new BitmapImage(new Uri("http://img.kutoo8.com//upload/thumb/583419/e47164658e5c23cf2424bbb72ef56b65_320x480.jpg")));
                Welcome.Inlines.Add(new Run($"早呀!"));
                Welcome.Inlines.Add(new LineBreak());
                Welcome.Inlines.Add(new Run("一日之计在于晨,早上是最宝贵的时间哦~")
                {
                    FontSize = 14
                });
            }
            else if (tmCur.Hour >= 13 && tmCur.Hour <= 17)
            {
                b.Background = new ImageBrush(new BitmapImage(new Uri("http://img.pconline.com.cn/images/upload/upc/tx/wallpaper/1207/30/c1/12613028_1343631802292.jpg")));
                Welcome.Inlines.Add(new Run($"下午好呀!"));
                Welcome.Inlines.Add(new LineBreak());
                Welcome.Inlines.Add(new Run("有什么新鲜事吗?")
                {
                    FontSize = 14
                });
            }
            LemonWeather w = new LemonWeather(He.Settings.WeatherInfo);

            Weather.Inlines.Add(new Run($"今日{w.WeatherName}天气"));
            Weather.Inlines.Add(new LineBreak());
            Weather.Inlines.Add(new Run(w.WeatherMessage));
        }