private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            this.K.Text = await Lemon_Updata.NewText(He.KMS);

            if (File.Exists(AppDomain.CurrentDomain.BaseDirectory + @"Setup.exe"))
            {
                File.Delete(AppDomain.CurrentDomain.BaseDirectory + @"Setup.exe");
            }
        }
Beispiel #2
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();
        }
Beispiel #3
0
        private async void Window_Loaded(object sender, RoutedEventArgs e)
        {
            BassNet.Registration("*****@*****.**", "2X211223140022");
            Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_CPSPEAKERS, new WindowInteropHelper(this).Handle);
            Rect rc = SystemParameters.WorkArea;

            this.MaxWidth  = rc.Width;
            this.MaxHeight = rc.Height;
            IntPtr handle = new WindowInteropHelper(this).Handle;

            RegisterHotKey(handle, 124, (uint)4, (uint)System.Windows.Forms.Keys.Z);
            RegisterHotKey(handle, 125, (uint)4, (uint)System.Windows.Forms.Keys.S);
            RegisterHotKey(handle, 126, (uint)4, (uint)System.Windows.Forms.Keys.X);
            RegisterHotKey(handle, 127, (uint)4, (uint)System.Windows.Forms.Keys.A);
            RegisterHotKey(handle, 128, (uint)4, (uint)System.Windows.Forms.Keys.End);
            RegisterHotKey(handle, 129, (uint)4, (uint)System.Windows.Forms.Keys.Q);
            InstallHotKeyHook(this);
            // FontFamily = new FontFamily(".PingFang SC");
            Font.Items.Clear();
            foreach (FontFamily font in Fonts.SystemFontFamilies)
            {
                Font.Items.Add(new ListBoxItem()
                {
                    Content = font.Source, FontFamily = font
                });
            }
            new WelcomeWindow().Show();
            new HaWindow().Show();
            //         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(He.Settings.UserImage))
            {
                var image = new System.Drawing.Bitmap(He.Settings.UserImage);
                tx.Background = new ImageBrush(image.ToImageSource());
            }
        }
Beispiel #4
0
 private async void Window_Loaded(object sender, RoutedEventArgs e)
 {
     this.K.Text = await Lemon_Updata.NewText(He.KMS);
 }