Ejemplo n.º 1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            KoobooUpgrade.DeleteUpgradeRemainedFiles();
            //第一次默认启动
            if (KoobooAutoStart.IsFirstTimeAutoStart())
            {
                KoobooAutoStart.AutoStart(true);
            }

            GlobalSettings.RootPath = Kooboo.Data.AppSettings.DatabasePath;

            KoobooStartUp.StartAll();
        }
Ejemplo n.º 2
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            KoobooUpgrade.DeleteUpgradeRemainedFiles();

            if (KoobooAutoStart.IsFirstBoot() ||         //first run default auto start
                KoobooAutoStart.IsAutoStart() ||         //override task when application path changed
                KoobooAutoStart.OldCodeHadSetAutoSart()) //compatible old code
            {
                KoobooAutoStart.AutoStart(true);
            }
            GlobalSettings.RootPath = Kooboo.Data.AppSettings.DatabasePath;
            KoobooStartUp.StartAll();
        }
Ejemplo n.º 3
0
        private void Init()
        {
            update.Content = Data.Language.Hardcoded.GetValue("Upgrade");

            title.Text = Data.Language.Hardcoded.GetValue("Setting");

            #region 语言设置
            langName.Text = Data.Language.Hardcoded.GetValue("Language");

            var systemLangCode = Data.Language.LanguageSetting.SystemLangCode;
            var cmslangs       = Data.Language.LanguageSetting.CmsLangs;

            cbLang.ItemsSource       = Data.Language.LanguageSetting.CmsLangs;
            cbLang.SelectedValuePath = "Key";
            cbLang.DisplayMemberPath = "Value";

            if (cmslangs.ContainsKey(systemLangCode))
            {
                cbLang.SelectedValue     = systemLangCode;
                cbLang.SelectionChanged += LangSelectedChange;
            }
            #endregion

            #region 自动升级
            lbupgrade.Text           = Data.Language.Hardcoded.GetValue("Upgrade");
            chAutoUpgrade.Content    = Data.Language.Hardcoded.GetValue("Auto Update");
            chAutoUpgrade.IsChecked  = KoobooUpgrade.IsAutoUpgrade;
            chAutoUpgrade.Checked   += AutoUpgradeEvent;
            chAutoUpgrade.Unchecked += AutoUpgradeEvent;
            #endregion
            #region 开机启动设置
            lbstart.Text           = Data.Language.Hardcoded.GetValue("Start-up");
            chAutoStart.Content    = Data.Language.Hardcoded.GetValue("Auto Start");
            chAutoStart.IsChecked  = KoobooAutoStart.IsAutoStart();
            chAutoStart.Checked   += AutoStartEvent;
            chAutoStart.Unchecked += AutoStartEvent;
            #endregion

            upgradetxt.Text = Data.Language.Hardcoded.GetValue("Version");
            var version = AppSettings.Version;
            update.Visibility   = Visibility.Hidden;
            currentVersion.Text = version.ToString();

            CheckVersion();

            right.Text  = "© " + System.DateTime.Now.Year.ToString() + " Kooboo. " + Data.Language.Hardcoded.GetValue("All rights reserved");
            vm.LinkText = "http://www.kooboo.com";
        }
Ejemplo n.º 4
0
        private void AutoStartEvent(object sender, RoutedEventArgs e)
        {
            var auto = chAutoStart.IsChecked.Value;

            KoobooAutoStart.AutoStart(auto);
        }