Пример #1
0
        private void restoreDefaultValues()
        {
            try
            {
                if (
                    PNMessageBox.Show(
                        PNLang.Instance.GetMessageText("def_warning",
                                                "You are about to reset ALL program settings to their default values. Continue?"),
                        @"PNotes.NET", MessageBoxButton.YesNo, MessageBoxImage.Asterisk) == MessageBoxResult.Yes)
                {
                    //preserve language
                    var language = PNStatic.Settings.GeneralSettings.Language;
                    //preserve password
                    var password = PNStatic.Settings.Protection.PasswordString;

                    _TempSettings.Dispose();
                    _TempSettings = new PNSettings
                    {
                        GeneralSettings = { Language = language },
                        Protection = { PasswordString = password }
                    };

                    initPageGeneral(false);
                    initPageSchedule(false);
                    initPageBehavior(false);
                    initPageNetwork(false);
                    initPageProtection(false);
                    initPageAppearance(false);
                    ((PNTreeItem)tvwGroups.Items[0]).IsSelected = true;
                    //remove active smtp client
                    foreach (var sm in _SmtpClients)
                        sm.Active = false;

                    chkNoSplash.IsChecked = false;

                    cmdRestoreFontUI.PerformClick();
                }
            }
            catch (Exception ex)
            {
                PNStatic.LogException(ex);
            }
        }
Пример #2
0
        private void DlgSettings_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                PNStatic.FormSettings = this;
                prepareLists();
                initializeComboBoxes();

                var f = new PNFont();
                cmdRestoreFontUI.IsEnabled = f != PNSingleton.Instance.FontUser;

                applyFirstTimeLanguage();
                //applyLanguage();

                PNStatic.FormMain.LanguageChanged += FormMain_LanguageChanged;

                _TempSettings = PNStatic.Settings.PNClone();
                _SyncComps = PNStatic.SyncComps.PNClone();
                _Groups = PNStatic.ContactGroups.PNClone();
                _Contacts = PNStatic.Contacts.PNClone();
                _Externals = PNStatic.Externals.PNClone();
                _SProviders = PNStatic.SearchProviders.PNClone();
                _SmtpClients = PNStatic.SmtpProfiles.PNClone();
                _MailContacts = PNStatic.MailContacts.PNClone();
                _Tags = PNStatic.Tags.PNClone();
                _TempDocking = (PNGroup)PNStatic.Docking.Clone();
                _SocialPlugins = PNStatic.PostPlugins.PNClone();
                _SyncPlugins = PNStatic.SyncPlugins.PNClone();

                initPageGeneral(true);
                initPageSchedule(true);
                initPageAppearance(true);
                initPageBehavior(true);
                initPageNetwork(true);
                initPageProtection(true);

                _TimerConnections.Elapsed += _TimerConnections_Elapsed;
                if (_TempSettings.Network.EnableExchange)
                    _TimerConnections.Start();

                _Loaded = true;
            }
            catch (Exception ex)
            {
                PNStatic.LogException(ex);
            }
        }
Пример #3
0
 public bool Equals(PNSettings set)
 {
     if ((object)set == null)
         return false;
     return (_GeneralSettings == set._GeneralSettings
         && _Schedule == set._Schedule
         && _Behavior == set._Behavior
         && _Protection == set._Protection
         && _Diary == set._Diary
         && _Network == set.Network);
 }