Esempio n. 1
0
        private void OtherClick(object sender, RoutedEventArgs e)
        {
            OtherTools other = new OtherTools(this);

            other.Show();
            this.Hide();
        }
Esempio n. 2
0
        public MainWindow()
        {
            Log.AddLog("app", "感谢使用 SS Tool Box,当前版本为" + verInfo.verStr + " build " + verInfo.verBulidTimes);
            Log.AddLog("main", "开始初始化界面……");
            startRun = DateTime.Now;

            InitializeComponent();

            main = this;

            // 亚克力模糊
            // WindowBlur.SetIsEnabled(this, true);

            #region 0 - 初始化基础服务

            Log.StartLogOut();                      // 日志
            Options.ReadOpt();                      // 设置
            // UI.ToastHelper.StartShower();        // 吐司

            // 颜色模式切换事件
            SystemEvents.UserPreferenceChanged +=
                new UserPreferenceChangedEventHandler(Event_UserPreferenceChanged);

            #endregion
            #region 1 - 初始化颜色主题

            if (Options.GetOpt("autoDarkMode")[0] == "true")
            {
                // 判断颜色模式
                string isOpen = Features.Reg.GetRegKey(Registry.CurrentUser, @"SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize", "AppsUseLightTheme");
                if (isOpen == "1")
                {
                    UI.Color.ChangeDark(false);
                }
            }
            else
            {
                if ((Options.GetOpt("darkMode"))[0] == "false")
                {
                    UI.Color.ChangeDark(false);
                }
            }
            string langValue = "en_US";
            if (Options.GetOpt("language")[0][0] != '~')
            {
                foreach (UI.Localization.localVer info in UI.Localization.indexLocals)
                {
                    if (info.value + ".xaml" == Options.GetOpt("language")[0])
                    {
                        langValue = info.value;
                        break;
                    }
                }
                UI.Localization.ChangeLanguage(langValue + ".xaml", true);
            }
            else
            {
                UI.Localization.ChangeLanguage(Options.GetOpt("language")[0].Substring(1), true, true);
            }

            #endregion
            #region 4 - 初始化页面

            // 版本号
            viewVersion.Text = verInfo.verStr;
#if DEBUG
            viewVersion.Text = verInfo.verStr + " DBuild " + verInfo.verBulidTimes;
#endif

            // 加载主页
            Home page = new Home();
            page.ParentWindow = this;
            MainCol.Content   = new Frame()
            {
                Content = page
            };

            // 初始化 Tab
            ColorTools colors = new ColorTools();
            colors.ParentWindow   = this;
            conColorTools.Content = new Frame()
            {
                Content = colors
            };
            OtherTools others = new OtherTools();
            others.ParentWindow   = this;
            conOtherTools.Content = new Frame()
            {
                Content = others
            };

            // 初始化 Home 按钮
            if (Options.GetOpt("alwaysShowHome")[0] == "true")
            {
                Home.Visibility = Visibility.Visible;
                Title.Margin    = new Thickness(10, 0, 0, 0);
            }
            #endregion
            #region 5 - 其他操作

            // 检查更新
            Thread thread = new Thread(getUpdate);
            MainWindow.threads.Push(thread);
            thread.Start();

            #endregion

            Log.AddLog("main", "加载完毕,耗时" + DateTime.Now.Subtract(startRun).TotalSeconds + "秒");
            loadDone = true;
        }
Esempio n. 3
0
 private void Start()
 {
     OtherTools.DisableSuperTinting(base.aiActor);
 }