Beispiel #1
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (Status.isAutoChandeTheme)
     {
         btnAutoNightMode.IsChecked = Status.isAutoChandeTheme;
         autoNightMode();
     }
     else
     {
         ConfigXmlPassage xml = new ConfigXmlPassage(Configure.Config.ConfigXmlPath);
         if (xml.GetTheme().Equals(Xml.XmlContext.Theme.Dark))
         {
             Status.isDark = true;
             ThemePassage.ThemeConvert(Theme.Dark);
         }
         else
         {
             Status.isDark = false;
             ThemePassage.ThemeConvert(Theme.Light);
         }
     }
     ThemePassage.IsCheckedLoad();
     new Languages.ControlLoad().Loaded(this);
     Data.AddAppLog("application runing");
 }
Beispiel #2
0
        public CompetitionPage()
        {
            InitializeComponent();

            time = new Time(3, 0, 0);
            TimerFun timerFun      = Countdown;
            bool     startOvertime = false;

            timer = new DispatcherTimer();

            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += (s, e) =>
            {
                timerFun(ref time);
                if (overtime != 0 && time == 0)
                {
                    startOvertime = true;
                    timerFun      = PositiveTiming;
                }
                else if (!startOvertime && time == 0)
                {
                    timer.Stop();
                }
                else if (startOvertime && time.Minute == overtime)
                {
                    timer.Stop();
                }
                if (endTime == DateTime.Now)
                {
                    Data.AddAppLog($"Time: {time.Hour}-{time.Minute}-{time.Second} .Deviation: {time.Hour*3600+time.Minute*60+time.Second} s");
                }
            };
        }
Beispiel #3
0
        public OrdinaryPage()
        {
            InitializeComponent();

            Data.AddAppLog("ordinary page show");
            updataFun();

            showRecordEvent       += showRecordFun;
            updataEvent           += updataFun;
            tickContorlThemeEvent += tickContorlThemeFuna;

            if (Setting.isShowRecord)
            {
                btnRecordA.Visibility = Visibility.Visible;
                btnRecordB.Visibility = Visibility.Visible;
            }
        }
Beispiel #4
0
        private void Window_Closed(object sender, EventArgs e)
        {
            ConfigXmlPassage xml = new ConfigXmlPassage(Configure.Config.ConfigXmlPath);

            if (Status.isDark)
            {
                xml.SetTheme(Xml.XmlContext.Theme.Dark);
            }
            else
            {
                xml.SetTheme(Xml.XmlContext.Theme.Light);
            }

            Data.AddAppLog("application close");
            if (Setting.AutoExportLog)
            {
                ShowLogWindow.ExportFile();
            }
            SetFile.ExportFile();
            Process.GetCurrentProcess().Kill();
        }