示例#1
0
        private void _SaveAndClose(Action close)
        {
            try
            {
                SaveFailed = false;
                AppSettings.Instance.Save(RefreshInterval, HideIcon, DisableNotifications, UseMetroStyle, InstallUpdates, AdditionalKbIds);
                StartupHelper.UpdateStartupSettings(IsSetAsAutoStartup);

                close();
            }
            catch (Exception)
            {
                SaveFailed = true;
            }
        }
        public void Start()
        {
            StartupHelper.UpdateExecPath();

            mVersionHelper.SearchForNewVersion(_OnNewVersionAvailable);

            // wait for 10 seconds (to finish startup), then search for updates
            mTimer.Interval = TimeSpan.FromSeconds(10);
            mTimer.Tick    += (e, s) => SearchForUpdates();
            mTimer.Start();

            AppSettings.Instance.OnSettingsChanged = _OnSettingsChanged;

            Application.Current.Deactivated += (s, e) => _OnApplicationDeactivated();
            Application.Current.Activated   += (s, e) => _OnApplicationActivated();
        }