private void UpdateTemplate()
        {
            var color = Helper.GetColorByOffset(_linearGradientBrush.GradientStops, SldTheme.Value / 7);

            ButtonHelper.SetCornerRadius(BtnCustom, new CornerRadius(SldCornerRadius.Value));
            BtnCustom.Width = SldWidth.Value;

            if (BtnCustom.Width < 60)
            {
                BtnCustom.Content = "";
                ButtonHelper.SetWaitingContent(BtnCustom, null);
            }
            else
            {
                BtnCustom.Content = " Button";
                ButtonHelper.SetWaitingContent(BtnCustom, "Please wait...");
            }


            switch (ButtonHelper.GetButtonStyle(BtnCustom))
            {
            case ButtonStyle.Standard:
                BtnCustom.Foreground = Colors.White.ToBrush();
                BtnCustom.Background = new Color()
                {
                    A = 200, R = color.R, G = color.G, B = color.B
                }.ToBrush();
                ButtonHelper.SetHoverBrush(BtnCustom, color.ToBrush());
                break;

            case ButtonStyle.Hollow:
                BtnCustom.Background  = Colors.Transparent.ToBrush();
                BtnCustom.Foreground  = color.ToBrush();
                BtnCustom.BorderBrush = color.ToBrush();
                ButtonHelper.SetHoverBrush(BtnCustom, color.ToBrush());
                break;

            case ButtonStyle.Outline:
                BtnCustom.Background = Colors.Transparent.ToBrush();
                BtnCustom.Foreground = new Color()
                {
                    A = 150, R = color.R, G = color.G, B = color.B
                }.ToBrush();
                BtnCustom.BorderBrush = new Color()
                {
                    A = 150, R = color.R, G = color.G, B = color.B
                }.ToBrush();
                ButtonHelper.SetHoverBrush(BtnCustom, color.ToBrush());
                break;

            case ButtonStyle.Link:
                BtnCustom.Background = Colors.Transparent.ToBrush();
                BtnCustom.Foreground = new Color()
                {
                    A = 150, R = color.R, G = color.G, B = color.B
                }.ToBrush();
                ButtonHelper.SetHoverBrush(BtnCustom, color.ToBrush());
                break;
            }
        }
Beispiel #2
0
        public Updater()
        {
            InitializeComponent();

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            this.Background = baseColora.Tran;
            WindowXCaption.SetHeight(this, 0);

            this.MT1.Foreground = baseColora.Fg;
            this.MT1.FontFamily = baseColora.Fonts;
            this.MT1.FontSize   = 15;

            this.T1.Foreground = baseColora.Fg;
            this.T1.FontFamily = baseColora.Fonts;
            this.T1.FontSize   = 13;
            this.T2.Foreground = baseColora.Fg;
            this.T2.FontFamily = baseColora.Fonts;
            this.T2.FontSize   = 13;

            this.ICON.Foreground = baseColora.Fg;
            ButtonHelper.SetHoverBrush(ICON, baseColora.Fg);

            this.pbDown.Background = baseColora.DBg;
            this.pbDown.Foreground = baseColora.Main;
            ProgressBarHelper.SetCornerRadius(pbDown, 0);

            Thread thread = new Thread(Start);

            thread.Start();
        }
Beispiel #3
0
        public KnowledgeWiki()
        {
            InitializeComponent();
            viewModel   = new KnowledgeWikiViewModel();
            DataContext = viewModel;

            foreach (var knowledge in viewModel.Knowledges)
            {
                Button button = new Button();
                button.Content = $" {knowledge.Knowledge} ";
                //button.Width = 160;
                button.Height = 40;
                button.Margin = new Thickness(10, 5, 10, 5);
                button.Name   = "btn" + knowledge.Id.Replace("-", "");
                button.Tag    = knowledge;
                Binding binding = new Binding()
                {
                    Source = knowledge,
                    Path   = new PropertyPath("Visibility"),
                    Mode   = BindingMode.TwoWay,
                    UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged
                };
                BindingOperations.SetBinding(button, Button.VisibilityProperty, binding);
                ButtonHelper.SetButtonStyle(button, ButtonStyle.Hollow);
                ButtonHelper.SetClickStyle(button, ClickStyle.Sink);
                ButtonHelper.SetCornerRadius(button, new CornerRadius(4));
                ButtonHelper.SetHoverBrush(button, "#00BCFF".ToColor().ToBrush());
                button.BorderBrush = "#20A0FF".ToColor().ToBrush();
                button.Foreground  = "#20A0FF".ToColor().ToBrush();
                button.Click      += Button_Click;
                this.content.Children.Add(button);
            }
        }
Beispiel #4
0
        public PassWordEnterF7()
        {
            InitializeComponent();

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            this.Background = baseColora.Tran;
            WindowXCaption.SetHeight(this, 0);

            this.Time.Background = baseColora.DBg;
            this.Time.Foreground = baseColora.Main;
            ProgressBarHelper.SetCornerRadius(Time, 0);
            Border.Background = baseColora.DBg;

            this.Password.Background = baseColora.DBg;
            this.Password.Foreground = baseColora.Fg;

            ButtonHelper.SetHoverBrush(B1, baseColora.Tran);
            this.B1.Background = baseColora.Tran;

            Timer timer = new Timer();

            timer          = new Timer(1000);
            timer.Elapsed += new ElapsedEventHandler(OnTimedEvent);
            timer.Enabled  = true;
        }
Beispiel #5
0
        public PageHD1()
        {
            loadingtimes = DateTime.Now;

            InitializeComponent();

            this.Height = 477;

            String stTitle = "Smartisan OS 图标获取";

            this.Title.Foreground = baseColora.Fg;
            this.Title.FontFamily = baseColora.Fonts;
            this.Title.FontSize   = 17;
            Title.Text            = stTitle;

            String stSays = "通过POST网页获取地址的方法从锤科服务器上获取重绘过的APP图标。";

            this.Says.Foreground = baseColora.Fg;
            this.Says.FontFamily = baseColora.Fonts;
            this.Says.FontSize   = 14;
            Says.Text            = stSays;

            this.T1.Foreground = baseColora.Fg;
            this.T1.FontFamily = baseColora.Fonts;
            this.T1.FontSize   = 13;
            this.T4.Foreground = baseColora.Fg;
            this.T4.FontFamily = baseColora.Fonts;
            this.T4.FontSize   = 13;
            this.T5.Foreground = baseColora.Fg;
            this.T5.FontFamily = baseColora.Fonts;
            this.T5.FontSize   = 13;

            this.MT2.Foreground = baseColora.Fg;
            this.MT2.FontFamily = baseColora.Fonts;
            this.MT2.FontSize   = 15;

            this.RunCard.Background  = baseColora.Card;
            this.CD1.Background      = baseColora.Card;
            this.IconCard.Background = baseColora.Card;

            this.PackageIn.Background = baseColora.Bg;
            this.PackageIn.Foreground = baseColora.Font;

            this.Percent.Background = baseColora.DBg;

            this.RunButton.Foreground = baseColora.Fg;
            this.RunButton.Background = baseColora.Tran;

            ButtonHelper.SetHoverBrush(RunButton, baseColora.DBg);

            this.RunCard.Visibility  = Visibility.Collapsed;
            this.Errorsay.Visibility = Visibility.Collapsed;
            this.IconCard.Visibility = Visibility.Collapsed;

            error.logWriter("加载工具完成,耗时:" + (DateTime.Now - loadingtimes).ToString(), false);
        }
Beispiel #6
0
        private void updateUI()
        {
            Point inScreen = new Point(0, 0);

            try
            {
                inScreen = PointToScreen(new System.Windows.Point(0, 0));
            }
            catch { }
            Color color = GetColor((int)inScreen.X - 3, (int)inScreen.Y - 3);

            if (color.R * 0.299 + color.G * 0.578 + color.B * 0.114 >= 192)
            { //浅色
                brush.Color     = Color.FromArgb(255, 0, 0, 0);
                brushfont.Color = Color.FromArgb(255, 255, 255, 255);
                WindowXCaption.SetForeground(this, brush);
            }
            else
            {  //深色
                brush.Color     = Color.FromArgb(255, 255, 255, 255);
                brushfont.Color = Color.FromArgb(255, 0, 0, 0);
                WindowXCaption.SetForeground(this, brush);
            }
            FontFamily font = new FontFamily("方正兰亭简黑");

            this.T1.Foreground = brush;
            this.T1.FontFamily = font;
            this.T1.FontSize   = 13;
            this.T2.Foreground = brush;
            this.T2.FontFamily = font;
            this.T2.FontSize   = 13;
            this.T3.Foreground = brush;
            this.T3.FontFamily = font;
            this.T3.FontSize   = 13;
            this.T4.Foreground = brush;
            this.T4.FontFamily = font;
            this.T4.FontSize   = 13;
            this.T5.Foreground = brush;
            this.T5.FontFamily = font;
            this.T5.FontSize   = 13;

            this.B1.Foreground = brush;
            this.B2.Foreground = brush;
            this.B3.Foreground = brush;
            this.B4.Foreground = brush;
            this.B5.Foreground = brush;

            this.WHEREOK.Foreground = brush;
            this.TIMEOK.Foreground  = brush;
            ButtonHelper.SetHoverBrush(WHEREOK, brush);
            ButtonHelper.SetHoverBrush(TIMEOK, brush);

            this.WHERE.Foreground = brush;
            this.TIME.Foreground  = brush;
        }
Beispiel #7
0
        public Page4()
        {
            InitializeComponent();

            this.Height = 477;

            String stTitle = "倒计时";

            this.Title.Foreground =
                baseColora.Fg;
            this.Title.FontFamily = baseColora.Fonts;;
            this.Title.FontSize   = 17;
            Title.Text            = stTitle;

            String stSays = "这儿会显示各种乱七八糟的倒计时,也可以自定义倒计时。";

            this.Says.Foreground = baseColora.Fg;
            this.Says.FontFamily = baseColora.Fonts;
            this.Says.FontSize   = 14;
            Says.Text            = stSays;

            this.T4.Foreground = baseColora.Fg;
            this.T4.FontFamily = baseColora.Fonts;
            this.T4.FontSize   = 13;

            this.MT2.Foreground = baseColora.Fg;
            this.MT2.FontFamily = baseColora.Fonts;
            this.MT2.FontSize   = 15;

            this.RunCard.Background = baseColora.Card;
            this.CD1.Background     = baseColora.Card;
            this.CD2.Background     = baseColora.Card;

            this.Percent.Background = baseColora.DBg;


            ButtonHelper.SetHoverBrush(RunButton, baseColora.DBg);
            ButtonHelper.SetHoverBrush(ClearButton, baseColora.Fg);

            this.RunButton.Foreground   = baseColora.Fg;
            this.ClearButton.Foreground = baseColora.Fg;
            this.RunButton.Background   = baseColora.Tran;
            this.ClearButton.Background = baseColora.Tran;

            this.RunCard.Visibility  = Visibility.Collapsed;
            this.Errorsay.Visibility = Visibility.Collapsed;

            bool error = UpdateData();
        }
Beispiel #8
0
        public SSMessageBox()
        {
            InitializeComponent();

            SSMessageHelper.buttonOK = false;
            SSMessageHelper.buttonNO = false;

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            this.Background   = baseColora.Tran;
            Border.Background = baseColora.DBg;
            WindowXCaption.SetHeight(this, 0);

            this.ICON.Foreground = baseColora.Fg;
            ButtonHelper.SetHoverBrush(ICON, baseColora.Fg);
            ButtonHelper.SetIcon(ICON, ButtonHelper.GetIcon(SSMessageHelper.Icon));
            this.OK.Content    = SSMessageHelper.bOKtext;
            this.OK.Foreground = baseColora.Fg;
            this.OK.Background = baseColora.Bg;
            ButtonHelper.SetHoverBrush(OK, baseColora.Main);
            ButtonHelper.SetCornerRadius(OK, new CornerRadius(3, 3, 3, 3));
            this.CANC.Content    = SSMessageHelper.bNOtext;
            this.CANC.Foreground = baseColora.Fg;
            this.CANC.Background = baseColora.Bg;
            ButtonHelper.SetHoverBrush(CANC, baseColora.Main);
            ButtonHelper.SetCornerRadius(CANC, new CornerRadius(3, 3, 3, 3));

            this.TITLE.Text       = SSMessageHelper.Title;
            this.TITLE.Foreground = baseColora.Fg;
            this.TITLE.Background = baseColora.Tran;
            this.TITLE.FontFamily = baseColora.Fonts;
            this.TITLE.FontSize   = 25;

            this.SAY.Text       = "       " + SSMessageHelper.Says;
            this.SAY.Foreground = baseColora.Fg;
            this.SAY.Background = baseColora.Tran;
            this.SAY.FontFamily = baseColora.Fonts;
            this.SAY.FontSize   = 16;

            if (SSMessageHelper.noNo)
            {
                this.CANC.Visibility = Visibility.Collapsed;
            }
        }
Beispiel #9
0
 private void ChbExtendControl_CheckChanged(object sender, RoutedEventArgs e)
 {
     if (ChbExtendControl.IsChecked != true)
     {
         GroupBoxHelper.SetExtendControl(GrpCustom, null);
     }
     else
     {
         var button = new Button()
         {
             Content    = "details >",
             Margin     = new Thickness(0, 0, 5, 0),
             Foreground = "#AA57A2E0".ToColor().ToBrush()
         };
         ButtonHelper.SetButtonStyle(button, ButtonStyle.Link);
         ButtonHelper.SetHoverBrush(button, "#57A2E0".ToColor().ToBrush());
         GroupBoxHelper.SetExtendControl(GrpCustom, button);
     }
 }
Beispiel #10
0
        public KillSTL()
        {
            InitializeComponent();
            Height  = 500;
            Topmost = true;

            this.T20.Text = "这就是一个超级简单的、超级普通的、超级正常的养成对战类回合制文字游戏 / ?,灵感来自STL。同时这也是SSTB内涵的第一个游戏为主的彩蛋。";
            this.T19.Text = "相杀象征相爱\nBy Stapx Steve [ 林槐 ] @2019 / 版权所有";

            setTitle(version);
            this.T2.Text  = "Version - " + version;
            this.T18.Text = "Version - " + version;

            WindowXCaption.SetBackground(this, baseColora.Main);
            WindowXCaption.SetForeground(this, baseColora.FontM);

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            BG1.BeginInit();
            BG1.Source = baseColora.Bgpa;
            BG1.EndInit();
            BG2.BeginInit();
            BG2.Source = baseColora.Bgpa;
            BG2.EndInit();

            this.TT.Foreground = baseColora.Main;

            this.T.Foreground   = baseColora.Fg;
            this.T1.Foreground  = baseColora.Fg;
            this.T2.Foreground  = baseColora.Fg;
            this.T3.Foreground  = baseColora.Fg;
            this.T4.Foreground  = baseColora.Fg;
            this.T5.Foreground  = baseColora.Fg;
            this.T6.Foreground  = baseColora.Fg;
            this.T7.Foreground  = baseColora.Fg;
            this.T8.Foreground  = baseColora.Fg;
            this.T9.Foreground  = baseColora.Fg;
            this.T10.Foreground = baseColora.Fg;
            this.T11.Foreground = baseColora.Fg;
            this.T12.Foreground = baseColora.Fg;
            this.T13.Foreground = baseColora.Fg;
            this.T14.Foreground = baseColora.Fg;
            this.T15.Foreground = baseColora.Fg;
            this.T16.Foreground = baseColora.Fg;
            this.T17.Foreground = baseColora.Fg;
            this.T18.Foreground = baseColora.Fg;
            this.T19.Foreground = baseColora.Fg;
            this.T20.Foreground = baseColora.Fg;

            this.TopIcon.Background = baseColora.Main;
            this.TopIcon.Foreground = baseColora.FontM;
            ButtonHelper.SetHoverBrush(TopIcon, baseColora.Main);
            ButtonHelper.SetClickCoverOpacity(TopIcon, 1);

            this.RunButton.Foreground = baseColora.Font;
            this.RunButton.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(RunButton, baseColora.Main);
            this.Pass.Foreground = baseColora.Font;
            this.Pass.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(Pass, baseColora.Main);
            this.Exit.Foreground = baseColora.Font;
            this.Exit.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(Exit, baseColora.Main);
            this.Hits.Foreground = baseColora.Font;
            this.Hits.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(Hits, baseColora.Main);

            this.MainTab.Background = baseColora.Bg;
            this.MainTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(MainTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(MainTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(MainTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(MainTab, baseColora.Fg);
            this.GameTab.Background = baseColora.Bg;
            this.GameTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(GameTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(GameTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(GameTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(GameTab, baseColora.Fg);

            this.Hit.Background = baseColora.DBg;
            this.Hit.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Hit, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Hit, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Hit, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Hit, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Hit, baseColora.Fg);
            this.Do.Background = baseColora.DBg;
            this.Do.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Do, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Do, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Do, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Do, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Do, baseColora.Fg);
            this.Give.Background = baseColora.DBg;
            this.Give.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Give, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Give, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Give, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Give, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Give, baseColora.Fg);

            this.BagBD.Background = baseColora.DBg;
            ListViewItem listViewItem = new ListViewItem();

            listViewItem.Name = "空";
            TextBlock textBlock = new TextBlock();

            textBlock.Text       = "  空";
            textBlock.Foreground = baseColora.Font;
            textBlock.FontSize   = 14;
            listViewItem.Content = textBlock;
            Bag.Items.Add(listViewItem);

            this.Health.Background = baseColora.DBg;
            this.Health.Foreground = baseColora.Main;
            this.Love.Background   = baseColora.DBg;
            this.Love.Foreground   = baseColora.Main;
            this.Hug.Background    = baseColora.DBg;
            this.Hug.Foreground    = baseColora.Main;
            this.Duang.Background  = baseColora.DBg;
            this.Duang.Foreground  = baseColora.Main;

            this.yHealth.Background = baseColora.DBg;
            this.yHealth.Foreground = baseColora.Main;
            this.yLove.Background   = baseColora.DBg;
            this.yLove.Foreground   = baseColora.Main;
            this.yHug.Background    = baseColora.DBg;
            this.yHug.Foreground    = baseColora.Main;
            this.yDuang.Background  = baseColora.DBg;
            this.yDuang.Foreground  = baseColora.Main;

            this.Run.Background = baseColora.DBg;
            this.Run.Foreground = baseColora.Fg;

            CMD.Foreground    = baseColora.Font;
            CMDCOL.Foreground = baseColora.Font;

            this.MainGame.Visibility = Visibility.Collapsed;

            CMDIN.Visibility = Visibility.Collapsed;

            if (PageHD2.opin)
            {
                you = "Stapx Steve";
                op  = true;
            }

            customHit.Add(new customerHit()
            {
                ID = 0, Name = "  - 空 -", ShowName = "空", Hit = 0, HitMax = 0, Love = 0, LoveMax = 0, Hug = 0, HugMax = 0, Duang = 0, DuangMax = 0
            });
            customHit.Add(new customerHit()
            {
                ID = 1, Name = "  - 轻拳 -", ShowName = "轻拳", Hit = -10, HitMax = -5, Love = -1, LoveMax = 0, Hug = -45, HugMax = -25, Duang = 1, DuangMax = 2
            });
            Hit.ItemsSource       = customHit;
            Hit.DisplayMemberPath = "Name";
            Hit.SelectedValuePath = "ID";
            Hit.SelectedValue     = 0;

            customGive.Add(new customerGive()
            {
                ID = 0, Name = "  - 空 -", ShowName = "空", Hit = 0, HitMax = 0, Love = 0, LoveMax = 0, Hug = 0, HugMax = 0, Buff = "", BuffPes = 0
            });
            customGive.Add(new customerGive()
            {
                ID = 1, Name = "  - 面包 -", ShowName = "面包", Hit = 0, HitMax = 0, Love = 0, LoveMax = 2, Hug = 10, HugMax = 10, Buff = "吃撑", BuffPes = 5
            });
            Give.ItemsSource       = customGive;
            Give.DisplayMemberPath = "Name";
            Give.SelectedValuePath = "ID";
            Give.SelectedValue     = 0;

            customDo.Add(new customerDo()
            {
                ID = 0, Name = "  - 空 -", ShowName = "空", Hit = 0, HitMax = 0, Love = 0, LoveMax = 0, Hug = 0, HugMax = 0, Buff = "", BuffPes = 0
            });
            customDo.Add(new customerDo()
            {
                ID = 1, Name = "  - 捏捏 -", ShowName = "捏捏", Hit = 0, HitMax = 0, Love = 0, LoveMax = 2, Hug = -5, HugMax = -2, Buff = "", BuffPes = 0
            });
            Do.ItemsSource       = customDo;
            Do.DisplayMemberPath = "Name";
            Do.SelectedValuePath = "ID";
            Do.SelectedValue     = 0;
        }
Beispiel #11
0
        public Page5()
        {
            InitializeComponent();

            this.Height = 477;

            String stTitle = "F**k QQ";

            this.Title.Foreground = baseColora.Fg;
            this.Title.FontFamily = baseColora.Fonts;;
            this.Title.FontSize   = 17;
            Title.Text            = stTitle;

            String stSays = "这儿是所有QQ相关功能的集合。某些操作需要使用到你的QQ号,请保证此QQ在登录状态。";

            this.Says.Foreground = baseColora.Fg;
            this.Says.FontFamily = baseColora.Fonts;
            this.Says.FontSize   = 14;
            Says.Text            = stSays;

            this.T1.Foreground = baseColora.Fg;
            this.T1.FontFamily = baseColora.Fonts;
            this.T1.FontSize   = 13;
            this.T4.Foreground = baseColora.Fg;
            this.T4.FontFamily = baseColora.Fonts;
            this.T4.FontSize   = 13;
            this.T5.Foreground = baseColora.Fg;
            this.T5.FontFamily = baseColora.Fonts;
            this.T5.FontSize   = 13;
            this.T3.Foreground = baseColora.Fg;
            this.T3.FontFamily = baseColora.Fonts;
            this.T3.FontSize   = 13;

            this.MT2.Foreground = baseColora.Fg;
            this.MT2.FontFamily = baseColora.Fonts;
            this.MT2.FontSize   = 15;
            this.MT3.Foreground = baseColora.Fg;
            this.MT3.FontFamily = baseColora.Fonts;
            this.MT3.FontSize   = 15;

            this.CD1.Background      = baseColora.Card;
            this.RunCard.Background  = baseColora.Card;
            this.HandCard.Background = baseColora.Card;
            this.ColCard.Background  = baseColora.Card;

            this.RunButton.Foreground = baseColora.Fg;
            this.RunButton.Background = baseColora.Tran;
            this.About.Foreground     = baseColora.Fg;
            this.About.Background     = baseColora.Tran;
            this.Chat.Foreground      = baseColora.Fg;
            this.Chat.Background      = baseColora.Tran;

            this.QQ.Background  = baseColora.Bg;
            this.QQY.Background = baseColora.Bg;
            this.QQ.Foreground  = baseColora.Fg;
            this.QQY.Foreground = baseColora.Fg;


            ButtonHelper.SetHoverBrush(RunButton, baseColora.DBg);

            this.Percent.Background = baseColora.DBg;

            this.RunCard.Visibility  = Visibility.Collapsed;
            this.Errorsay.Visibility = Visibility.Collapsed;
            this.HandCard.Visibility = Visibility.Collapsed;
            this.ColCard.Visibility  = Visibility.Collapsed;
        }
Beispiel #12
0
        private bool UpdateUI()
        {
            IsMaskVisible = false;

            //初始化颜色
            if (!LoadingMain(false))
            {
                Application.Current.Shutdown();
            }

            //版本号
            Versionon.Text = "Version - " + stVersion;

            //刷新工具列表
            UpdateList.ItemsSource = listall;

            //工具列表样式
            this.UpdateList.Foreground = baseColor.Fg;
            this.UpdateList.FontFamily = baseColor.Fonts;
            this.UpdateList.FontSize   = 14;

            //版本号样式
            this.Versionon.Foreground = baseColor.Fg;
            this.Versionon.FontFamily = baseColor.Fonts;
            this.Versionon.FontSize   = 12;

            //按钮样式
            this.Feedback.Foreground   = baseColor.FontM;
            this.Feedback.FontFamily   = baseColor.Fonts;
            this.Feedback.FontSize     = 14;
            this.OpenButton.Foreground = baseColor.FontM;
            this.OpenButton.Background = baseColor.Main;
            this.B1.Foreground         = baseColor.Fg;
            this.B2.Foreground         = baseColor.Fg;
            this.TopIcon.Background    = baseColor.Main;
            this.TopIcon.Foreground    = baseColor.FontM;
            ButtonHelper.SetHoverBrush(TopIcon, baseColor.Main);
            ButtonHelper.SetClickCoverOpacity(TopIcon, 1);

            //初始化卡片颜色
            WindowXCaption.SetBackground(this, baseColor.Main);
            WindowXCaption.SetForeground(this, baseColor.FontM);

            CD1.Background = baseColor.Card;
            CD2.Background = baseColor.Card;
            SH1.Background = baseColor.Card;

            SH1.Foreground                    = baseColor.Font;
            UpdateList.Background             = baseColor.Tran;
            Versionon.Foreground              = baseColor.Fg;
            UpdateList.ContextMenu.Background = baseColor.Card;
            UpdateList.ContextMenu.Foreground = baseColor.Fg;
            ContextMenuHelper.SetShadowColor(UpdateList.ContextMenu, baseColor.DBg.Color);

            BorderBut.Background  = baseColor.DBg;
            BorderTop.Background  = baseColor.Main;
            BorderTop1.Background = baseColor.Main;
            BorderTop2.Background = baseColor.Main;

            BG.BeginInit();
            BG.Source = baseColor.Bgp;
            BG.EndInit();
            SBG.BeginInit();
            SBG.Source = baseColor.Bgps;
            SBG.EndInit();

            //加载主页
            PageMain main = new PageMain();

            Page.Content = new Frame()
            {
                Content = main
            };

            return(true);
        }
Beispiel #13
0
        public Page7()
        {
            InitializeComponent();

            this.Height = 477;

            String stTitle = "记事簿";

            this.Title.Foreground = baseColora.Fg;
            this.Title.FontFamily = baseColora.Fonts;;
            this.Title.FontSize   = 17;
            Title.Text            = stTitle;

            String stSays = "就是个普普通通的记事簿而已。";

            this.Says.Foreground = baseColora.Fg;
            this.Says.FontFamily = baseColora.Fonts;
            this.Says.FontSize   = 14;
            Says.Text            = stSays;

            this.T1.Foreground = baseColora.Fg;
            this.T1.FontFamily = baseColora.Fonts;
            this.T1.FontSize   = 13;
            this.T2.Foreground = baseColora.Fg;
            this.T2.FontFamily = baseColora.Fonts;
            this.T2.FontSize   = 13;
            this.T4.Foreground = baseColora.Fg;
            this.T4.FontFamily = baseColora.Fonts;
            this.T4.FontSize   = 13;
            this.T3.Foreground = baseColora.Fg;
            this.T3.FontFamily = baseColora.Fonts;
            this.T3.FontSize   = 13;
            this.T5.Foreground = baseColora.Fg;
            this.T5.FontFamily = baseColora.Fonts;
            this.T5.FontSize   = 13;
            this.T6.Foreground = baseColora.Fg;
            this.T6.FontFamily = baseColora.Fonts;
            this.T6.FontSize   = 13;

            this.MT1.Foreground = baseColora.Fg;
            this.MT1.FontFamily = baseColora.Fonts;
            this.MT1.FontSize   = 15;

            this.CD1.Background     = baseColora.Card;
            this.CD2.Background     = baseColora.Card;
            this.LOAD.Background    = baseColora.Card;
            this.RunCard.Background = baseColora.Card;

            this.RunButton.Foreground = baseColora.Fg;
            this.RunButton.Background = baseColora.Tran;
            this.Start.Foreground     = baseColora.Fg;
            this.Start.Background     = baseColora.Tran;

            this.What.Background = baseColora.DBg;
            this.What.Foreground = baseColora.Fg;

            this.AddWhat.Background = baseColora.DBg;
            this.AddWhat.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(AddWhat, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(AddWhat, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(AddWhat, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(AddWhat, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(AddWhat, baseColora.Fg);
            this.AddWhere.Background = baseColora.DBg;
            this.AddWhere.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(AddWhere, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(AddWhere, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(AddWhere, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(AddWhere, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(AddWhere, baseColora.Fg);

            this.CanDel.Background = baseColora.Bg;
            CheckBoxHelper.SetCheckedBackground(CanDel, baseColora.Main);
            CheckBoxHelper.SetCheckedGlyphBrush(CanDel, baseColora.DBg);
            CheckBoxHelper.SetGlyphBrush(CanDel, baseColora.DBg);

            ButtonHelper.SetHoverBrush(RunButton, baseColora.Main);
            ButtonHelper.SetHoverBrush(Start, baseColora.Main);

            this.Load.Foreground = baseColora.Fg;

            this.Percent.Background = baseColora.DBg;

            this.RunCard.Visibility  = Visibility.Collapsed;
            this.Errorsay.Visibility = Visibility.Collapsed;
            this.CD1.Visibility      = Visibility.Collapsed;
            this.CD2.Visibility      = Visibility.Collapsed;
            this.AdW.Visibility      = Visibility.Collapsed;
            this.HID.Visibility      = Visibility.Collapsed;

            //初始化列表
            IList <listMain> AddWhatList = new List <listMain>();

            AddWhatList.Add(new listMain()
            {
                ID = 0, Name = "  < 空 >"
            });
            AddWhatList.Add(new listMain()
            {
                ID = 1, Name = "  普通卡片"
            });
            AddWhatList.Add(new listMain()
            {
                ID = 2, Name = "  普通事件"
            });
            AddWhat.ItemsSource       = AddWhatList;
            AddWhat.DisplayMemberPath = "Name";
            AddWhat.SelectedValuePath = "ID";
            AddWhat.SelectedValue     = 0;

            //初始化目录&读取设置
            if (!Directory.Exists("SSTB/Files/Setups"))
            {
                Directory.CreateDirectory("SSTB/Files/Setups");
            }
            if (!File.Exists("SSTB/Files/Setups/NoteSaves.json"))
            {
                JObject Stat = new JObject {
                    { "Version", FileVersion.ToString() }, { "NumOfDef", "0" }
                };
                JObject Cards = new JObject();
                Notes.Add("Stat", Stat);
                Cards.Add("Def", new JObject());
                Notes.Add("Cards", Cards);
                try
                {
                    using (StreamWriter sw = new StreamWriter("SSTB/Files/Setups/NoteSaves.json"))
                    {
                        sw.WriteLine(Notes.ToString());
                        sw.Close();
                    }
                }
                catch (Exception ex)
                {
                    this.RunCard.Visibility = Visibility.Visible;
                    error.ErrorTo("写入存储文件错误:", "" + ex, Percent, Errorsay);
                    error.logWriter("写入存储文件错误:" + ex, false);
                    err = true;
                }
            }
            else
            {
                Notes = new JObject {
                    { "Error", "true" }
                };
                try
                {
                    string jsonfile = "SSTB/Files/Setups/NoteSaves.json";
                    using (System.IO.StreamReader file = System.IO.File.OpenText(jsonfile))
                    {
                        using (JsonTextReader reader = new JsonTextReader(file))
                        {
                            Notes = (JObject)JToken.ReadFrom(reader);
                        }
                    }
                }
                catch (Exception ex)
                {
                    this.RunCard.Visibility = Visibility.Visible;
                    error.ErrorTo("读取存储文件错误:", "" + ex, Percent, Errorsay);
                    error.logWriter("读取存储文件错误:" + ex, false);
                    err = true;
                }
                try
                {
                    this.RunCard.Visibility = Visibility.Visible;
                    string Error = Notes["Error"].ToString();
                    error.ErrorTo("读取数据无效。", Percent, Errorsay);
                    error.logWriter("读取数据无效。", false);
                    err = true;
                }
                catch
                {
                    this.RunCard.Visibility = Visibility.Collapsed;
                }
                if (!err)
                {
                    if (int.Parse(Notes["Stat"]["NumOfDef"].ToString()) == 0)
                    {
                        this.MT1.Visibility = Visibility.Collapsed;
                    }
                }

                int   delCard = 0;
                int[] things  = new int[1];
                if (!err && int.Parse(Notes["Stat"]["NumOfDef"].ToString()) != 0)
                {
                    for (int i = 1; i <= int.Parse(Notes["Stat"]["NumOfDef"].ToString()); i++)
                    {
                        if (int.Parse(Notes["Cards"]["Def"][i.ToString()]["Stat"].ToString()) == 0 && int.Parse(Notes["Cards"]["Def"][i.ToString()]["Finished"].ToString()) == 0)
                        {
                            Notes["Cards"]["Def"][i.ToString()].Parent.Remove();
                            Notes["Stat"]["NumOfDef"] = (int.Parse(Notes["Stat"]["NumOfDef"].ToString()) - 1).ToString();
                            delCard++;
                            continue;
                        }
                        things[0] = i;
                        AddColtrols(1, things, Notes["Cards"]["Def"][i.ToString()]["Title"].ToString());
                    }
                }
                SaveData(Notes);
                if (delCard > 0)
                {
                    MT1.Text = "存在的卡片(已忽略空卡片 " + delCard + " 个):";
                }
            }
        }
Beispiel #14
0
        public About()
        {
            InitializeComponent();

            WindowXCaption.SetBackground(this, baseColora.Main);
            WindowXCaption.SetForeground(this, baseColora.FontM);

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            BG1.BeginInit();
            BG1.Source = baseColora.Bgpa;
            BG1.EndInit();
            BG2.BeginInit();
            BG2.Source = baseColora.Bgpa;
            BG2.EndInit();

            this.MainTab.Background = baseColora.Bg;
            this.MainTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(MainTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(MainTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(MainTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(MainTab, baseColora.Fg);

            ButtonHelper.SetHoverBrush(B1, baseColora.Bg);
            IconHelper.SetForeground(B1, baseColora.Fg);
            this.B1.Foreground = baseColora.Fg;
            this.B1.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B2, baseColora.Fg);
            IconHelper.SetForeground(B2, baseColora.Fg);
            this.B2.Foreground = baseColora.Fg;
            this.B2.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B3, baseColora.Bg);
            IconHelper.SetForeground(B3, baseColora.Fg);
            this.B3.Foreground = baseColora.Fg;
            this.B3.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B4, baseColora.Bg);
            IconHelper.SetForeground(B4, baseColora.Fg);
            this.B4.Foreground = baseColora.Fg;
            this.B4.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B5, baseColora.Bg);
            IconHelper.SetForeground(B5, baseColora.Fg);
            this.B5.Foreground = baseColora.Fg;
            this.B5.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B6, baseColora.Bg);
            IconHelper.SetForeground(B6, baseColora.Fg);
            this.B6.Foreground = baseColora.Fg;
            this.B6.Background = baseColora.Tran;
            ButtonHelper.SetHoverBrush(B7, baseColora.Bg);
            IconHelper.SetForeground(B7, baseColora.Fg);
            this.B7.Foreground = baseColora.Fg;
            this.B7.Background = baseColora.Tran;

            this.CD1.Background = baseColora.Bg;
            this.CD2.Background = baseColora.Bg;
            this.CD3.Background = baseColora.Bg;
            this.CD4.Background = baseColora.Bg;

            //SS列表样式
            this.SS.Foreground  = baseColora.Fg;
            this.SS.FontFamily  = baseColora.Fonts;
            this.SS.FontSize    = 22;
            this.BLC.Foreground = baseColora.Fg;
            this.BLC.FontFamily = baseColora.Fonts;
            this.BLC.FontSize   = 22;

            this.WhoSS.Text        = "       这是一只喜欢做UI排版的SS,喜欢折腾。有事没事就想做点什么……然而大半都做不完的说,米粉、谷歌粉,会卖萌/大雾,没什么事的话可以陪聊(?) ,QQ , Twitter都行/逃。";
            this.WhoBLC.Text       = "       [ 这个人什么都没留下 ]";
            this.WhoSS.Foreground  = baseColora.Fg;
            this.WhoSS.FontFamily  = baseColora.Fonts;
            this.WhoSS.FontSize    = 14;
            this.WhoBLC.Foreground = baseColora.Fg;
            this.WhoBLC.FontFamily = baseColora.Fonts;
            this.WhoBLC.FontSize   = 14;

            this.MT1.Foreground = baseColora.Fg;
            this.MT1.FontFamily = baseColora.Fonts;
            this.MT1.FontSize   = 15;
            this.MT2.Foreground = baseColora.Fg;
            this.MT2.FontFamily = baseColora.Fonts;
            this.MT2.FontSize   = 15;
            this.MT3.Foreground = baseColora.Fg;
            this.MT3.FontFamily = baseColora.Fonts;
            this.MT3.FontSize   = 15;
            this.MT4.Foreground = baseColora.Fg;
            this.MT4.FontFamily = baseColora.Fonts;
            this.MT4.FontSize   = 15;

            this.S1.Foreground = baseColora.Fg;
            this.S1.FontFamily = baseColora.Fonts;
            this.S1.FontSize   = 13;
            this.S2.Foreground = baseColora.Fg;
            this.S2.FontFamily = baseColora.Fonts;
            this.S2.FontSize   = 13;
            this.S3.Foreground = baseColora.Fg;
            this.S3.FontFamily = baseColora.Fonts;
            this.S3.FontSize   = 13;
            this.S4.Foreground = baseColora.Fg;
            this.S4.FontFamily = baseColora.Fonts;
            this.S4.FontSize   = 13;
        }
Beispiel #15
0
        private bool UpdateUI()
        {
            WindowXCaption.SetBackground(this, baseColora.Main);
            WindowXCaption.SetForeground(this, baseColora.FontM);

            BG.BeginInit();
            BG.Source = baseColora.Bgpa;
            BG.EndInit();
            BG1.BeginInit();
            BG1.Source = baseColora.Bgpa;
            BG1.EndInit();
            BG2.BeginInit();
            BG2.Source = baseColora.Bgpa;
            BG2.EndInit();
            BG3.BeginInit();
            BG3.Source = baseColora.Bgpa;
            BG3.EndInit();

            //样式
            this.T11.Foreground = baseColora.Fg;
            this.T11.FontFamily = baseColora.Fonts;
            this.T11.FontSize   = 13;
            this.T12.Foreground = baseColora.Fg;
            this.T12.FontFamily = baseColora.Fonts;
            this.T12.FontSize   = 13;
            this.T13.Foreground = baseColora.Fg;
            this.T13.FontFamily = baseColora.Fonts;
            this.T13.FontSize   = 13;
            this.T14.Foreground = baseColora.Fg;
            this.T14.FontFamily = baseColora.Fonts;
            this.T14.FontSize   = 13;
            this.T15.Foreground = baseColora.Fg;
            this.T15.FontFamily = baseColora.Fonts;
            this.T15.FontSize   = 13;
            this.T16.Foreground = baseColora.Fg;
            this.T16.FontFamily = baseColora.Fonts;
            this.T16.FontSize   = 13;
            this.T17.Foreground = baseColora.Fg;
            this.T17.FontFamily = baseColora.Fonts;
            this.T17.FontSize   = 13;
            this.T18.Foreground = baseColora.Fg;
            this.T18.FontFamily = baseColora.Fonts;
            this.T18.FontSize   = 13;
            this.T21.Foreground = baseColora.Fg;
            this.T21.FontFamily = baseColora.Fonts;
            this.T21.FontSize   = 13;
            this.T22.Foreground = baseColora.Fg;
            this.T22.FontFamily = baseColora.Fonts;
            this.T22.FontSize   = 13;
            this.T31.Foreground = baseColora.Fg;
            this.T31.FontFamily = baseColora.Fonts;
            this.T31.FontSize   = 13;
            this.T41.Foreground = baseColora.Fg;
            this.T41.FontFamily = baseColora.Fonts;
            this.T41.FontSize   = 13;

            this.MT11.Foreground = baseColora.Fg;
            this.MT11.FontFamily = baseColora.Fonts;
            this.MT11.FontSize   = 15;
            this.MT12.Foreground = baseColora.Fg;
            this.MT12.FontFamily = baseColora.Fonts;
            this.MT12.FontSize   = 15;
            this.MT13.Foreground = baseColora.Fg;
            this.MT13.FontFamily = baseColora.Fonts;
            this.MT13.FontSize   = 15;
            this.MT21.Foreground = baseColora.Fg;
            this.MT21.FontFamily = baseColora.Fonts;
            this.MT21.FontSize   = 15;
            this.MT31.Foreground = baseColora.Fg;
            this.MT31.FontFamily = baseColora.Fonts;
            this.MT31.FontSize   = 15;
            this.MT41.Foreground = baseColora.Fg;
            this.MT41.FontFamily = baseColora.Fonts;
            this.MT41.FontSize   = 15;

            this.CD11.Background = baseColora.Bg;
            this.CD12.Background = baseColora.Bg;
            this.CD13.Background = baseColora.Bg;
            this.CD21.Background = baseColora.Bg;
            this.CD32.Background = baseColora.Bg;
            this.CD41.Background = baseColora.Bg;

            this.C11.Background = baseColora.DBg;
            this.C31.Background = baseColora.DBg;
            this.C32.Background = baseColora.DBg;
            CheckBoxHelper.SetCheckedBackground(C11, baseColora.DBg);
            CheckBoxHelper.SetCheckedBackground(C31, baseColora.DBg);
            CheckBoxHelper.SetCheckedBackground(C32, baseColora.DBg);
            CheckBoxHelper.SetGlyphBrush(C11, baseColora.DBg);
            CheckBoxHelper.SetGlyphBrush(C31, baseColora.DBg);
            CheckBoxHelper.SetGlyphBrush(C32, baseColora.DBg);
            CheckBoxHelper.SetCheckedGlyphBrush(C11, baseColora.Main);
            CheckBoxHelper.SetCheckedGlyphBrush(C31, baseColora.Main);
            CheckBoxHelper.SetCheckedGlyphBrush(C32, baseColora.Main);

            this.MainTab.Background = baseColora.Bg;
            this.MainTab.Foreground = baseColora.Fg;
            TabControlHelper.SetHeaderPanelBackground(MainTab, baseColora.DBg);
            TabControlHelper.SetItemIcon(MainTab, baseColora.DBg);
            TabControlHelper.SetSelectedBackground(MainTab, baseColora.Bg);
            TabControlHelper.SetSelectedForeground(MainTab, baseColora.Fg);

            this.Theams.Background = baseColora.DBg;
            this.Theams.Foreground = baseColora.Fg;
            ComboBoxHelper.SetShadowColor(Theams, baseColora.Bg.Color);
            ComboBoxHelper.SetHoverBackground(Theams, baseColora.Bg);
            ComboBoxHelper.SetHoverForeground(Theams, baseColora.Fg);
            ComboBoxHelper.SetSelectedBackground(Theams, baseColora.DBg);
            ComboBoxHelper.SetSelectedForeground(Theams, baseColora.Fg);

            this.S11.Background = baseColora.DBg;
            this.S11.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S11, baseColora.Main);
            this.S12.Background = baseColora.DBg;
            this.S12.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S12, baseColora.Main);
            this.S13.Background = baseColora.DBg;
            this.S13.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S13, baseColora.Main);
            this.S14.Background = baseColora.DBg;
            this.S14.Foreground = baseColora.Fg;
            SliderHelper.SetThemeBrush(S14, baseColora.Main);

            this.TopIcon.Background = baseColora.Main;
            this.TopIcon.Foreground = baseColora.FontM;
            ButtonHelper.SetHoverBrush(TopIcon, baseColora.Main);
            ButtonHelper.SetClickCoverOpacity(TopIcon, 1);
            this.MBG.Foreground = baseColora.Fg;
            this.MBG.Background = baseColora.DBg;
            this.SBG.Foreground = baseColora.Fg;
            this.SBG.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(MBG, baseColora.DBg);
            ButtonHelper.SetHoverBrush(SBG, baseColora.DBg);
            this.B21.Foreground = baseColora.Fg;
            this.B21.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(B21, baseColora.DBg);
            this.B41.Foreground = baseColora.Fg;
            this.B41.Background = baseColora.DBg;
            ButtonHelper.SetHoverBrush(B41, baseColora.DBg);

            this.Password.Background  = baseColora.Bg;
            this.Password.Foreground  = baseColora.Fg;
            this.UpdateLog.Background = baseColora.Bg;
            this.UpdateLog.Foreground = baseColora.Fg;

            return(true);
        }