Пример #1
0
 private void MainWindow_Loaded(object sender, RoutedEventArgs e)
 {
     //读取配置
     daima.Peizhi.duqu_jiben();
     //初始化计时器
     timer          = new DispatcherTimer();
     timer.Interval = TimeSpan.FromMilliseconds(500);
     timer.Tick    += timer1_Tick;
     timer.Start();
     //透明度
     rec1.Opacity = daima.Peizhi.Toumingdu;
     //初始化按钮
     if (daima.Peizhi.Shifou_suoding == true)
     {
         btn_suo.Visibility   = Visibility.Collapsed;
         btn_suo_1.Visibility = Visibility.Visible;
     }
     else
     {
         btn_suo.Visibility   = Visibility.Visible;
         btn_suo_1.Visibility = Visibility.Collapsed;
     }
     if (daima.Peizhi.Shifou_zhiding == true)
     {
         btn_zhiding.Visibility   = Visibility.Collapsed;
         btn_zhiding_1.Visibility = Visibility.Visible;
         this.Topmost             = true;
     }
     else
     {
         btn_zhiding.Visibility   = Visibility.Visible;
         btn_zhiding_1.Visibility = Visibility.Collapsed;
         this.Topmost             = false;
     }
     //获取数据
     try
     {
         //检查是否登入
         if (daima.Peizhi.DedeUserID == "")
         {
             var result = MessageBoxX.Show("未登入Bilibili账号,可能会导致API调用受阻,点击“是的”将打开二维码登入界面,点击“不”将继续获取信息。后续可以点击设置按钮进行登录和其他高级设置", "错误", Application.Current.MainWindow, MessageBoxButton.YesNo, new MessageBoxXConfigurations()
             {
                 MessageBoxStyle = MessageBoxStyle.Classic,
                 MessageBoxIcon  = MessageBoxIcon.Error,
                 ButtonBrush     = "#FF4C4C".ToColor().ToBrush(),
             });
             if (result == MessageBoxResult.Yes)
             {
                 dengru dengru_ = new dengru();
                 dengru_.ShowDialog();
             }
         }
         //检查up主信息
         if (daima.Peizhi.Up == "")
         {
             var result = MessageBoxX.Show("绑定的UP主的uuid为空,将为你打开设置,请输入正确的uuid", "错误", Application.Current.MainWindow, MessageBoxButton.YesNo, new MessageBoxXConfigurations()
             {
                 MessageBoxStyle = MessageBoxStyle.Classic,
                 MessageBoxIcon  = MessageBoxIcon.Error,
                 ButtonBrush     = "#FF4C4C".ToColor().ToBrush(),
             });
             if (result == MessageBoxResult.Yes)
             {
                 shezhi shezhi_ = new shezhi();
                 shezhi_.Show();
                 return;
             }
             else
             {
                 this.Close();
                 return;
             }
         }
         //shuju.shuaxin_shuju(daima.Peizhi.Up,daima.Peizhi.huoqu_cook());
     }
     catch (Exception exc)
     {
         Notice.Show("获取信息失败,详细信息<" + exc.Message + ">", "Error", 10, MessageBoxIcon.Error);
         daima.Peizhi.tuichudengru();
         dengru dengru_ = new dengru();
         dengru_.Show();
     }
 }
Пример #2
0
        private void btn_she_Click(object sender, RoutedEventArgs e)
        {
            shezhi shezhi_ = new shezhi();

            shezhi_.Show();
        }