PEPSettings.cs
author Dean
Thu, 21 Jul 2016 15:08:16 +0200
changeset 1090 6234a0b9c6a8
child 1107 26d3dc22c30f
permissions -rw-r--r--
Add PEPSettings class and move all add-in configuration into it.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1090
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     1
using Microsoft.Win32;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     2
using System;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     3
using System.Collections.Generic;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     4
using System.ComponentModel;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     5
using System.Globalization;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     6
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     7
namespace pEp
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     8
{
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
     9
    /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    10
    /// Class to store and maintain all configurations/settings for pEp for Outlook.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    11
    /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    12
    internal class PEPSettings : INotifyPropertyChanged,
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    13
                                 Interfaces.IReset
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    14
    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    15
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    16
        /// Event raised when a property is changed on a component.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    17
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    18
        public event PropertyChangedEventHandler PropertyChanged;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    19
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    20
        public const string REG_KEY_SOFTWARE                                    = "Software";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    21
        public const string REG_KEY_PEP                                         = "pEp";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    22
        public const string REG_KEY_PEP_FOR_OUTLOOK                             = "Outlook";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    23
        public const string REG_KEY_PEP_UPDATER                                 = "Updater";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    24
        public const string REG_KEY_MICROSOFT_OFFICE                            = "Microsoft\\Office";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    25
        public const string REG_KEY_ENCRYPTED_ACCOUNTS_LIST                     = "EncryptedAccountsList";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    26
        public const string REG_NAME_ACCOUNT_WHITELIST                          = "AccountWhitelist";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    27
        public const string REG_NAME_CRASH_REPORT_SEND_ADDRESS                  = "CrashReportSendAddress";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    28
        public const string REG_NAME_DEFAULT_CODEPAGE_OUT                       = "Default_CodePageOut"; // Name defined by Microsoft
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    29
        public const string REG_NAME_EXTRA_KEYS                                 = "ExtraKeys";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    30
        public const string REG_NAME_IS_AUTO_UPDATE_ENABLED                     = "IsAutoUpdateEnabled";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    31
        public const string REG_NAME_IS_CRASH_REPORT_VISIBLE                    = "IsCrashReportVisible";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    32
        public const string REG_NAME_IS_DEVELOPER_MODE_ENABLED                  = "IsDeveloperModeEnabled";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    33
        public const string REG_NAME_IS_DISABLE_PROTECTION_FOR_CONTACTS_ENABLED = "IsDisableProtectionForContactsEnabled";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    34
        public const string REG_NAME_IS_ENCRYPT_ALL_ACCOUNTS_ENABLED            = "IsEncryptAllAccountsEnabled";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    35
        public const string REG_NAME_IS_KEY_SERVER_USED                         = "IsKeyServerUsed";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    36
        public const string REG_NAME_IS_PASSIVE_MODE_ENABLED                    = "IsPassiveModeEnabled";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    37
        public const string REG_NAME_IS_PEP_FOLDER_VISIBLE                      = "IsPEPFolderVisible";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    38
        public const string REG_NAME_IS_TNEF_DISABLED                           = "DisableTNEF"; // Name defined by Microsoft
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    39
        public const string REG_NAME_IS_UNENCRYPTED_SUBJECT_ENABLED             = "IsUnencryptedSubjectEnabled";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    40
        public const string REG_NAME_IS_VERBOSE_LOGGING_ENABLED                 = "IsVerboseLoggingEnabled";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    41
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    42
        public static readonly string[]    ACCOUNT_WHITELIST_DEFAULT                          = new string[] { };
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    43
        public const string                CRASH_REPORT_SEND_ADDRESS_DEFAULT                  = "crashreport@prettyeasyprivacy.com";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    44
        public const string                CULTURE_CODE_DEFAULT                               = "en";
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    45
        public static readonly CultureInfo CULTURE_DEFAULT                                    = new CultureInfo(CULTURE_CODE_DEFAULT);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    46
        public const bool                  ENCRYPT_ACCOUNTS_BY_DEFAULT                        = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    47
        public const bool                  IS_AUTO_UPDATE_ENABLED_DEFAULT                     = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    48
        public const bool                  IS_CRASH_REPORT_VISIBLE_DEFAULT                    = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    49
        public const bool                  IS_DEVELOPER_MODE_ENABLED_DEFAULT                  = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    50
        public const bool                  IS_DISABLE_PROTECTION_FOR_CONTACTS_ENABLED_DEFAULT = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    51
        public const bool                  IS_ENCRYPT_ALL_ACCOUNTS_ENABLED_DEFAULT            = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    52
        public const bool                  IS_KEY_SERVER_USED_DEFAULT                         = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    53
        public const bool                  IS_PASSIVE_MODE_ENABLED_DEFAULT                    = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    54
        public const bool                  IS_PEP_FOLDER_VISIBLE_DEFAULT                      = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    55
        public const bool                  IS_TNEF_DISABLED_DEFAULT                           = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    56
        public const bool                  IS_UNENCRYPTED_SUBJECT_ENABLED_DEFAULT             = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    57
        public const bool                  IS_VERBOSE_LOGGING_ENABLED_DEFAULT                 = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    58
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    59
        private string[]                 _AccountWhitelist;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    60
        private CultureInfo              _ActiveCulture;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    61
        private string                   _CrashReportSendAddress;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    62
        private Dictionary<string, bool> _EncryptedAccountsList;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    63
        private string[]                 _ExtraKeys;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    64
        private bool                     _IsAutoUpdateEnabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    65
        private bool                     _IsCrashReportVisible;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    66
        private bool                     _IsDeveloperModeEnabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    67
        private bool                     _IsDisableProtectionForContactsEnabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    68
        private bool                     _IsEncryptAllAccountsEnabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    69
        private bool                     _IsKeyServerUsed;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    70
        private bool                     _IsPassiveModeEnabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    71
        private bool                     _IsPEPFolderVisible;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    72
        private bool                     _IsTNEFDisabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    73
        private bool                     _IsUnencryptedSubjectEnabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    74
        private bool                     _IsVerboseLoggingEnabled;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    75
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    76
        /**************************************************************
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    77
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    78
         * Constructors
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    79
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    80
         *************************************************************/
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    81
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    82
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    83
        /// Default constructor.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    84
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    85
        public PEPSettings()
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    86
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    87
            this.Reset();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    88
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    89
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    90
        /**************************************************************
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    91
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    92
         * Property Accessors
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    93
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    94
         *************************************************************/
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    95
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    96
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    97
        /// Gets the account whitelist as the combination of hardcoded and registry values.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    98
        /// Can only be set from the registry or hardcoded values.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
    99
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   100
        public string[] AccountWhitelist
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   101
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   102
            get { return (this._AccountWhitelist); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   103
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   104
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   105
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   106
        /// Gets or sets the active culture.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   107
        /// This should be set from the UI language.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   108
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   109
        public CultureInfo ActiveCulture
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   110
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   111
            get { return (this._ActiveCulture); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   112
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   113
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   114
                this._ActiveCulture = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   115
                this.RaisePropertyChangedEvent("ActiveCulture");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   116
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   117
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   118
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   119
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   120
        /// Gets the email address to send any crash report to.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   121
        /// Can only be set from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   122
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   123
        public string CrashReportSendAddress
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   124
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   125
            get { return (this._CrashReportSendAddress); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   126
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   127
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   128
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   129
        /// Gets the encrypted accounts list (as a dictionary) used to show which accounts are encrypted.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   130
        /// This is only those accounts which existed already in the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   131
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   132
        public Dictionary<string, bool> EncryptedAccountsList
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   133
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   134
            get { return (this._EncryptedAccountsList); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   135
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   136
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   137
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   138
        /// Gets any extra encryption keys that were loaded from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   139
        /// Can only be set from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   140
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   141
        public string[] ExtraKeys
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   142
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   143
            get { return (this._ExtraKeys); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   144
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   145
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   146
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   147
        /// Gets or sets whether auto update is enabled.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   148
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   149
        public bool IsAutoUpdateEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   150
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   151
            get { return (this._IsAutoUpdateEnabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   152
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   153
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   154
                this._IsAutoUpdateEnabled = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   155
                this.RaisePropertyChangedEvent("IsAutoUpdateEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   156
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   157
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   158
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   159
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   160
        /// Gets whether the crash report window is visible to the user.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   161
        /// Can only be set from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   162
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   163
        public bool IsCrashReportVisible
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   164
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   165
            get { return (this._IsCrashReportVisible); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   166
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   167
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   168
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   169
        /// Gets whether developer mode is enabled.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   170
        /// Can only be set from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   171
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   172
        public bool IsDeveloperModeEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   173
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   174
            get { return (this._IsDeveloperModeEnabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   175
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   176
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   177
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   178
        /// Gets whether disabling protection per contact is enabled.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   179
        /// Can only be set from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   180
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   181
        public bool IsDisableProtectionForContactsEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   182
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   183
            get { return (this._IsDisableProtectionForContactsEnabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   184
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   185
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   186
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   187
        /// Gets or sets whether data should be stored encrypted for all accounts.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   188
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   189
        public bool IsEncryptAllAccountsEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   190
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   191
            get { return (this._IsEncryptAllAccountsEnabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   192
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   193
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   194
                this._IsEncryptAllAccountsEnabled = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   195
                this.RaisePropertyChangedEvent("IsEncryptAllAccountsEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   196
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   197
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   198
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   199
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   200
        /// Gets or sets whether to use key servers.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   201
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   202
        public bool IsKeyServerUsed
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   203
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   204
            get { return (this._IsKeyServerUsed); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   205
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   206
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   207
                this._IsKeyServerUsed = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   208
                this.RaisePropertyChangedEvent("IsKeyServerUsed");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   209
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   210
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   211
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   212
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   213
        /// Gets or sets whether passive mode is enabled.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   214
        /// Passive mode will not attach keys unless keys are received.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   215
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   216
        public bool IsPassiveModeEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   217
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   218
            get { return (this._IsPassiveModeEnabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   219
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   220
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   221
                this._IsPassiveModeEnabled = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   222
                this.RaisePropertyChangedEvent("IsPassiveModeEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   223
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   224
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   225
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   226
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   227
        /// Gets or sets whether the pEp folder (and its contents) are visible in the navigation pane.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   228
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   229
        public bool IsPEPFolderVisible
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   230
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   231
            get { return (this._IsPEPFolderVisible); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   232
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   233
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   234
                this._IsPEPFolderVisible = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   235
                this.RaisePropertyChangedEvent("IsPEPFolderVisible");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   236
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   237
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   238
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   239
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   240
        /// Gets or sets whether TNEF/RTF format is forcefully disabled in the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   241
        /// Can only be set from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   242
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   243
        public bool IsTNEFDisabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   244
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   245
            get { return (this._IsTNEFDisabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   246
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   247
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   248
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   249
        /// Gets or sets whether to enable encryption of message subjects.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   250
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   251
        public bool IsUnencryptedSubjectEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   252
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   253
            get { return (this._IsUnencryptedSubjectEnabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   254
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   255
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   256
                this._IsUnencryptedSubjectEnabled = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   257
                this.RaisePropertyChangedEvent("IsUnencryptedSubjectEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   258
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   259
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   260
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   261
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   262
        /// Gets or sets whether verbose logging is enabled.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   263
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   264
        public bool IsVerboseLoggingEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   265
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   266
            get { return (this._IsVerboseLoggingEnabled); }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   267
            set
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   268
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   269
                this._IsVerboseLoggingEnabled = value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   270
                this.RaisePropertyChangedEvent("IsVerboseLoggingEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   271
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   272
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   273
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   274
        /**************************************************************
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   275
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   276
         * Methods
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   277
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   278
         *************************************************************/
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   279
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   280
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   281
        /// Raises the property changed event, if possible, with the given arguments.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   282
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   283
        /// <param name="propertyName">The name of the property that changed.</param>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   284
        private void RaisePropertyChangedEvent(string propertyName)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   285
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   286
            if (this.PropertyChanged != null)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   287
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   288
                this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   289
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   290
            return;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   291
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   292
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   293
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   294
        /// Resets the object to it's default state/values.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   295
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   296
        public void Reset()
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   297
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   298
            this._AccountWhitelist = PEPSettings.ACCOUNT_WHITELIST_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   299
            this._ActiveCulture = PEPSettings.CULTURE_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   300
            this._CrashReportSendAddress = PEPSettings.CRASH_REPORT_SEND_ADDRESS_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   301
            this._EncryptedAccountsList = new Dictionary<string, bool>();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   302
            this._ExtraKeys = null;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   303
            this._IsAutoUpdateEnabled = PEPSettings.IS_AUTO_UPDATE_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   304
            this._IsCrashReportVisible = PEPSettings.IS_CRASH_REPORT_VISIBLE_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   305
            this._IsDeveloperModeEnabled = PEPSettings.IS_DEVELOPER_MODE_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   306
            this._IsDisableProtectionForContactsEnabled = PEPSettings.IS_DISABLE_PROTECTION_FOR_CONTACTS_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   307
            this._IsEncryptAllAccountsEnabled = PEPSettings.IS_ENCRYPT_ALL_ACCOUNTS_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   308
            this._IsKeyServerUsed = PEPSettings.IS_KEY_SERVER_USED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   309
            this._IsPassiveModeEnabled = PEPSettings.IS_PASSIVE_MODE_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   310
            this._IsPEPFolderVisible = PEPSettings.IS_PEP_FOLDER_VISIBLE_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   311
            this._IsTNEFDisabled = PEPSettings.IS_TNEF_DISABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   312
            this._IsUnencryptedSubjectEnabled = PEPSettings.IS_UNENCRYPTED_SUBJECT_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   313
            this._IsVerboseLoggingEnabled = PEPSettings.IS_VERBOSE_LOGGING_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   314
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   315
            this.RaisePropertyChangedEvent("AccountWhitelist");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   316
            this.RaisePropertyChangedEvent("ActiveCulture");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   317
            this.RaisePropertyChangedEvent("CrashReportSendAddress");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   318
            this.RaisePropertyChangedEvent("EncryptedAccountsList");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   319
            this.RaisePropertyChangedEvent("ExtraKeys");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   320
            this.RaisePropertyChangedEvent("IsAutoUpdateEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   321
            this.RaisePropertyChangedEvent("IsCrashReportVisible");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   322
            this.RaisePropertyChangedEvent("IsDeveloperModeEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   323
            this.RaisePropertyChangedEvent("IsDisableProtectionForContactsEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   324
            this.RaisePropertyChangedEvent("IsEncryptAllAccountsEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   325
            this.RaisePropertyChangedEvent("IsKeyServerUsed");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   326
            this.RaisePropertyChangedEvent("IsPassiveModeEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   327
            this.RaisePropertyChangedEvent("IsPEPFolderVisible");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   328
            this.RaisePropertyChangedEvent("IsTNEFDisabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   329
            this.RaisePropertyChangedEvent("IsUnencryptedSubjectEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   330
            this.RaisePropertyChangedEvent("IsVerboseLoggingEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   331
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   332
            return;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   333
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   334
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   335
        /**************************************************************
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   336
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   337
         * Registry Methods
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   338
         * 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   339
         *************************************************************/
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   340
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   341
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   342
        /// Writes/saves the updater config for Outlook to the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   343
        /// This should only be called after the value of _IsAutoUpdateEnabled is stable.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   344
        /// This method is called automatically within WriteConfigToRegistry().
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   345
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   346
        public void SaveUpdaterConfigToRegistry()
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   347
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   348
            string updateStr;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   349
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   350
            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   351
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   352
                if (this._IsAutoUpdateEnabled)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   353
                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   354
                    // Add/Update the registry key
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   355
                    using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey(PEPSettings.REG_KEY_SOFTWARE, true))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   356
                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   357
                        using (RegistryKey key2 = key1.CreateSubKey(PEPSettings.REG_KEY_PEP))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   358
                        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   359
                            using (RegistryKey keyUpdater = key2.CreateSubKey(PEPSettings.REG_KEY_PEP_UPDATER))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   360
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   361
                                updateStr = string.Format(pEp.Properties.Settings.Default.UpdateURL, pEp.Properties.Settings.Default.Serial);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   362
                                keyUpdater.SetValue(Globals.PEP_NAME_INSTALL, updateStr, RegistryValueKind.String);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   363
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   364
                        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   365
                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   366
                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   367
                else
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   368
                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   369
                    // Delete the registry key
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   370
                    using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey(PEPSettings.REG_KEY_SOFTWARE, true))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   371
                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   372
                        using (RegistryKey key2 = key1.CreateSubKey(PEPSettings.REG_KEY_PEP))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   373
                        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   374
                            using (RegistryKey keyUpdater = key2.CreateSubKey(PEPSettings.REG_KEY_PEP_UPDATER))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   375
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   376
                                keyUpdater.DeleteValue(Globals.PEP_NAME_INSTALL, false); // Do not throw exception
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   377
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   378
                        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   379
                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   380
                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   381
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   382
            catch (Exception ex)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   383
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   384
                Globals.Log("WriteUpdaterConfigToRegistry: Failure occured, " + ex.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   385
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   386
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   387
            return;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   388
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   389
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   390
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   391
        /// Writes/saves any supported configuration/property values to the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   392
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   393
        public void SaveToRegistry()
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   394
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   395
            /* Note: 
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   396
             * Do not save the below properties which can only be modified from the registry
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   397
             *   • AccountWhitelist
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   398
             *   • CrashReportSendAddress
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   399
             *   • ExtraKeys
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   400
             *   • IsCrashReportVisible
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   401
             *   • IsDeveloperModeEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   402
             *   • IsDisableProtectionForContactsEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   403
             *   • IsPassiveModeEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   404
             *   • IsTNEFDisabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   405
             */
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   406
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   407
            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   408
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   409
                using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey(PEPSettings.REG_KEY_SOFTWARE, true))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   410
                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   411
                    using (RegistryKey key2 = key1.CreateSubKey(PEPSettings.REG_KEY_PEP))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   412
                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   413
                        using (RegistryKey keyConfig = key2.CreateSubKey(PEPSettings.REG_KEY_PEP_FOR_OUTLOOK))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   414
                        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   415
                            // Set encryption state of each account
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   416
                            using (RegistryKey key3 = keyConfig.CreateSubKey(PEPSettings.REG_KEY_ENCRYPTED_ACCOUNTS_LIST))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   417
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   418
                                foreach (KeyValuePair<string, bool> entry in this._EncryptedAccountsList)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   419
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   420
                                    key3.SetValue(entry.Key,
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   421
                                                  entry.Value.ToString(),
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   422
                                                  RegistryValueKind.String);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   423
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   424
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   425
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   426
                            keyConfig.SetValue(PEPSettings.REG_NAME_IS_AUTO_UPDATE_ENABLED, this._IsAutoUpdateEnabled.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   427
                            keyConfig.SetValue(PEPSettings.REG_NAME_IS_ENCRYPT_ALL_ACCOUNTS_ENABLED, this._IsEncryptAllAccountsEnabled.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   428
                            keyConfig.SetValue(PEPSettings.REG_NAME_IS_KEY_SERVER_USED, this._IsKeyServerUsed.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   429
                            keyConfig.SetValue(PEPSettings.REG_NAME_IS_PEP_FOLDER_VISIBLE, this._IsPEPFolderVisible.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   430
                            keyConfig.SetValue(PEPSettings.REG_NAME_IS_UNENCRYPTED_SUBJECT_ENABLED, this._IsUnencryptedSubjectEnabled.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   431
                            keyConfig.SetValue(PEPSettings.REG_NAME_IS_VERBOSE_LOGGING_ENABLED, this._IsVerboseLoggingEnabled.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   432
                        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   433
                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   434
                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   435
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   436
                // Make sure to update the Updater registry values which can also be done separately
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   437
                this.SaveUpdaterConfigToRegistry();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   438
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   439
            catch (Exception ex)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   440
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   441
                Globals.Log("WriteConfigToRegistry: Failure occured, " + ex.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   442
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   443
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   444
            return;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   445
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   446
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   447
        /// <summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   448
        /// Reads/loads any configuration/property values from the registry.
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   449
        /// </summary>
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   450
        public void LoadFromRegistry()
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   451
        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   452
            bool isSuccessful;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   453
            bool isPropertySet;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   454
            int parsedIntValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   455
            bool parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   456
            string keyValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   457
            object value;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   458
            string[] registryWhitelist;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   459
            List<string> whitelist;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   460
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   461
            ///////////////////////////////////////////////////////////
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   462
            // Read non-pEp values
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   463
            ///////////////////////////////////////////////////////////
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   464
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   465
            // Attempt to get IsTNEFDisabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   466
            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   467
            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   468
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   469
                using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey(PEPSettings.REG_KEY_SOFTWARE))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   470
                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   471
                    using (RegistryKey keyOffice = key1.OpenSubKey(PEPSettings.REG_KEY_MICROSOFT_OFFICE))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   472
                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   473
                        /* Outlook versions
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   474
                         *  "12" Outlook 2007
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   475
                         *  "14" Outlook 2010
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   476
                         *  "15" Outlook 2013
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   477
                         *  "16" Outlook 2016
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   478
                         */
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   479
                        using (RegistryKey keyPreferences = keyOffice.OpenSubKey(Globals.ThisAddIn.Application.Version.Substring(0, 2) + ".0\\Outlook\\Preferences\\"))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   480
                        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   481
                            // Attempt to get IsTNEFDisabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   482
                            keyValue = keyPreferences.GetValue(PEPSettings.REG_NAME_IS_TNEF_DISABLED, PEPSettings.IS_TNEF_DISABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   483
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   484
                            // Try parsing as int
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   485
                            isSuccessful = int.TryParse(keyValue, out parsedIntValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   486
                            if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   487
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   488
                                this._IsTNEFDisabled = (parsedIntValue > 0);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   489
                                isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   490
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   491
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   492
                            // Try parsing as bool (this will handle the default value)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   493
                            if (isSuccessful == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   494
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   495
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   496
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   497
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   498
                                    this._IsTNEFDisabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   499
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   500
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   501
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   502
                        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   503
                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   504
                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   505
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   506
            catch (Exception ex)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   507
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   508
                Globals.Log("ReadConfigFromRegistry: Failure occured reading TNEF disabled status, " + ex.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   509
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   510
            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   511
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   512
                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   513
                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   514
                    this._IsTNEFDisabled = PEPSettings.IS_TNEF_DISABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   515
                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   516
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   517
                this.RaisePropertyChangedEvent("IsTNEFDisabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   518
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   519
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   520
            ///////////////////////////////////////////////////////////
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   521
            // Read pEp values
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   522
            ///////////////////////////////////////////////////////////
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   523
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   524
            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   525
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   526
                using (RegistryKey key1 = Registry.CurrentUser.OpenSubKey(PEPSettings.REG_KEY_SOFTWARE, true))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   527
                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   528
                    using (RegistryKey key2 = key1.CreateSubKey(PEPSettings.REG_KEY_PEP))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   529
                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   530
                        using (RegistryKey keyConfig = key2.CreateSubKey(PEPSettings.REG_KEY_PEP_FOR_OUTLOOK))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   531
                        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   532
                            // Attempt to get AccountWhitelist
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   533
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   534
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   535
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   536
                                value = keyConfig.GetValue(PEPSettings.REG_NAME_ACCOUNT_WHITELIST, null);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   537
                                if (value != null)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   538
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   539
                                    whitelist = new List<string>();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   540
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   541
                                    // Copy over hardcoded values
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   542
                                    for (int i = 0; i < PEPSettings.ACCOUNT_WHITELIST_DEFAULT.Length; i++)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   543
                                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   544
                                        whitelist.Add(PEPSettings.ACCOUNT_WHITELIST_DEFAULT[i].Trim());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   545
                                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   546
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   547
                                    // Copy over registry values
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   548
                                    registryWhitelist = value.ToString().Split(';');
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   549
                                    for (int i = 0; i < registryWhitelist.Length; i++)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   550
                                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   551
                                        whitelist.Add(registryWhitelist[i].Trim());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   552
                                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   553
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   554
                                    this._AccountWhitelist = whitelist.ToArray();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   555
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   556
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   557
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   558
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   559
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   560
                                Globals.Log("ReadConfigFromRegistry: Unable to read AccountWhitelist");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   561
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   562
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   563
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   564
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   565
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   566
                                    whitelist = new List<string>();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   567
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   568
                                    // Copy over hardcoded values
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   569
                                    for (int i = 0; i < PEPSettings.ACCOUNT_WHITELIST_DEFAULT.Length; i++)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   570
                                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   571
                                        whitelist.Add(PEPSettings.ACCOUNT_WHITELIST_DEFAULT[i].Trim());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   572
                                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   573
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   574
                                    this._AccountWhitelist = whitelist.ToArray();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   575
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   576
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   577
                                this.RaisePropertyChangedEvent("AccountWhitelist");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   578
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   579
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   580
                            // Attempt to get CrashReportSendAddress
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   581
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   582
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   583
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   584
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_CRASH_REPORT_SEND_ADDRESS, PEPSettings.CRASH_REPORT_SEND_ADDRESS_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   585
                                this._CrashReportSendAddress = keyValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   586
                                isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   587
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   588
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   589
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   590
                                Globals.Log("ReadConfigFromRegistry: Unable to read CrashReportSendAddress");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   591
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   592
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   593
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   594
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   595
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   596
                                    this._CrashReportSendAddress = PEPSettings.CRASH_REPORT_SEND_ADDRESS_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   597
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   598
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   599
                                this.RaisePropertyChangedEvent("CrashReportSendAddress");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   600
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   601
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   602
                            // Get encryption state of each account in the registry -- any previous values are cleared
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   603
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   604
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   605
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   606
                                this._EncryptedAccountsList.Clear();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   607
                                using (RegistryKey key3 = keyConfig.CreateSubKey(PEPSettings.REG_KEY_ENCRYPTED_ACCOUNTS_LIST))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   608
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   609
                                    foreach (string name in key3.GetValueNames())
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   610
                                    {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   611
                                        value = key3.GetValue(name, PEPSettings.ENCRYPT_ACCOUNTS_BY_DEFAULT);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   612
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   613
                                        if (value != null)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   614
                                        {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   615
                                            isSuccessful = bool.TryParse(value.ToString(), out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   616
                                            if ((isSuccessful) &&
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   617
                                                (this._EncryptedAccountsList.ContainsKey(name) == false))
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   618
                                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   619
                                                this._EncryptedAccountsList.Add(name, parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   620
                                                isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   621
                                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   622
                                        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   623
                                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   624
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   625
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   626
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   627
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   628
                                Globals.Log("ReadConfigFromRegistry: Unable to read EncryptedAccountsList");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   629
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   630
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   631
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   632
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   633
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   634
                                    this._EncryptedAccountsList.Clear();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   635
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   636
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   637
                                this.RaisePropertyChangedEvent("EncryptedAccountsList");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   638
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   639
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   640
                            // Attempt to get ExtraKeys value
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   641
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   642
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   643
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   644
                                value = keyConfig.GetValue(PEPSettings.REG_NAME_EXTRA_KEYS, null);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   645
                                if (value != null)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   646
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   647
                                    this._ExtraKeys = value.ToString().Split(',');
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   648
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   649
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   650
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   651
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   652
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   653
                                Globals.Log("ReadConfigFromRegistry: Unable to read ExtraKeys");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   654
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   655
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   656
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   657
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   658
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   659
                                    this._ExtraKeys = null;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   660
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   661
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   662
                                this.RaisePropertyChangedEvent("ExtraKeys");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   663
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   664
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   665
                            // Attempt to get IsAutoUpdateEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   666
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   667
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   668
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   669
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_AUTO_UPDATE_ENABLED, PEPSettings.IS_AUTO_UPDATE_ENABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   670
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   671
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   672
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   673
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   674
                                    this._IsAutoUpdateEnabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   675
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   676
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   677
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   678
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   679
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   680
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsAutoUpdateEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   681
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   682
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   683
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   684
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   685
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   686
                                    this._IsAutoUpdateEnabled = PEPSettings.IS_AUTO_UPDATE_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   687
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   688
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   689
                                this.RaisePropertyChangedEvent("IsAutoUpdateEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   690
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   691
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   692
                            // Attempt to get IsCrashReportVisible
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   693
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   694
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   695
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   696
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_CRASH_REPORT_VISIBLE, PEPSettings.IS_CRASH_REPORT_VISIBLE_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   697
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   698
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   699
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   700
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   701
                                    this._IsCrashReportVisible = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   702
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   703
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   704
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   705
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   706
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   707
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsCrashReportVisible");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   708
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   709
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   710
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   711
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   712
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   713
                                    this._IsCrashReportVisible = PEPSettings.IS_CRASH_REPORT_VISIBLE_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   714
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   715
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   716
                                this.RaisePropertyChangedEvent("IsCrashReportVisible");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   717
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   718
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   719
                            // Attempt to get IsDeveloperModeEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   720
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   721
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   722
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   723
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_DEVELOPER_MODE_ENABLED, PEPSettings.IS_DEVELOPER_MODE_ENABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   724
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   725
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   726
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   727
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   728
                                    this._IsDeveloperModeEnabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   729
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   730
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   731
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   732
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   733
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   734
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsDeveloperModeEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   735
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   736
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   737
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   738
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   739
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   740
                                    this._IsDeveloperModeEnabled = PEPSettings.IS_DEVELOPER_MODE_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   741
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   742
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   743
                                this.RaisePropertyChangedEvent("IsDeveloperModeEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   744
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   745
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   746
                            // Attempt to get IsDisableProtectionForContactsEnabled
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   747
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   748
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   749
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   750
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_DISABLE_PROTECTION_FOR_CONTACTS_ENABLED, PEPSettings.IS_DISABLE_PROTECTION_FOR_CONTACTS_ENABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   751
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   752
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   753
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   754
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   755
                                    this._IsDisableProtectionForContactsEnabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   756
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   757
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   758
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   759
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   760
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   761
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsDisableProtectionForContactsEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   762
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   763
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   764
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   765
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   766
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   767
                                    this._IsDisableProtectionForContactsEnabled = PEPSettings.IS_DISABLE_PROTECTION_FOR_CONTACTS_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   768
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   769
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   770
                                this.RaisePropertyChangedEvent("IsDisableProtectionForContactsEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   771
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   772
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   773
                            // Attempt to get IsEncryptAllAccountsEnabled value
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   774
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   775
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   776
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   777
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_ENCRYPT_ALL_ACCOUNTS_ENABLED, PEPSettings.IS_ENCRYPT_ALL_ACCOUNTS_ENABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   778
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   779
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   780
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   781
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   782
                                    this._IsEncryptAllAccountsEnabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   783
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   784
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   785
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   786
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   787
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   788
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsEncryptAllAccountsEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   789
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   790
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   791
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   792
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   793
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   794
                                    this._IsEncryptAllAccountsEnabled = PEPSettings.IS_ENCRYPT_ALL_ACCOUNTS_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   795
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   796
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   797
                                this.RaisePropertyChangedEvent("IsEncryptAllAccountsEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   798
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   799
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   800
                            // Attempt to get IsKeyServerUsed value
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   801
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   802
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   803
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   804
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_KEY_SERVER_USED, PEPSettings.IS_KEY_SERVER_USED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   805
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   806
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   807
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   808
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   809
                                    this._IsKeyServerUsed = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   810
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   811
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   812
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   813
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   814
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   815
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsKeyServerUsed");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   816
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   817
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   818
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   819
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   820
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   821
                                    this._IsKeyServerUsed = PEPSettings.IS_KEY_SERVER_USED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   822
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   823
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   824
                                this.RaisePropertyChangedEvent("IsKeyServerUsed");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   825
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   826
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   827
                            // Attempt to get IsPassiveModeEnabled value
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   828
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   829
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   830
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   831
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_PASSIVE_MODE_ENABLED, PEPSettings.IS_PASSIVE_MODE_ENABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   832
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   833
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   834
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   835
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   836
                                    this._IsPassiveModeEnabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   837
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   838
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   839
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   840
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   841
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   842
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsPassiveModeEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   843
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   844
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   845
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   846
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   847
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   848
                                    this._IsPassiveModeEnabled = PEPSettings.IS_PASSIVE_MODE_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   849
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   850
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   851
                                this.RaisePropertyChangedEvent("IsPassiveModeEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   852
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   853
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   854
                            // Attempt to get IsPEPFolderVisible value
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   855
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   856
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   857
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   858
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_PEP_FOLDER_VISIBLE, PEPSettings.IS_PEP_FOLDER_VISIBLE_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   859
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   860
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   861
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   862
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   863
                                    this._IsPEPFolderVisible = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   864
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   865
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   866
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   867
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   868
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   869
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsPEPFolderVisible");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   870
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   871
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   872
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   873
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   874
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   875
                                    this._IsPEPFolderVisible = PEPSettings.IS_PEP_FOLDER_VISIBLE_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   876
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   877
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   878
                                this.RaisePropertyChangedEvent("IsPEPFolderVisible");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   879
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   880
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   881
                            // Attempt to get IsUnencryptedSubjectEnabled value
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   882
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   883
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   884
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   885
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_UNENCRYPTED_SUBJECT_ENABLED, PEPSettings.IS_UNENCRYPTED_SUBJECT_ENABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   886
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   887
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   888
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   889
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   890
                                    this._IsUnencryptedSubjectEnabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   891
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   892
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   893
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   894
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   895
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   896
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsUnencryptedSubjectEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   897
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   898
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   899
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   900
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   901
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   902
                                    this._IsUnencryptedSubjectEnabled = PEPSettings.IS_UNENCRYPTED_SUBJECT_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   903
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   904
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   905
                                this.RaisePropertyChangedEvent("IsUnencryptedSubjectEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   906
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   907
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   908
                            // Attempt to get IsVerboseLoggingEnabled value
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   909
                            isPropertySet = false;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   910
                            try
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   911
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   912
                                keyValue = keyConfig.GetValue(PEPSettings.REG_NAME_IS_VERBOSE_LOGGING_ENABLED, PEPSettings.IS_VERBOSE_LOGGING_ENABLED_DEFAULT).ToString();
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   913
                                isSuccessful = bool.TryParse(keyValue, out parsedBoolValue);
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   914
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   915
                                if (isSuccessful)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   916
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   917
                                    this._IsVerboseLoggingEnabled = parsedBoolValue;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   918
                                    isPropertySet = true;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   919
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   920
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   921
                            catch
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   922
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   923
                                Globals.Log("ReadConfigFromRegistry: Unable to read IsVerboseLoggingEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   924
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   925
                            finally
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   926
                            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   927
                                if (isPropertySet == false)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   928
                                {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   929
                                    this._IsVerboseLoggingEnabled = PEPSettings.IS_VERBOSE_LOGGING_ENABLED_DEFAULT;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   930
                                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   931
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   932
                                this.RaisePropertyChangedEvent("IsVerboseLoggingEnabled");
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   933
                            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   934
                        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   935
                    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   936
                }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   937
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   938
            catch (Exception ex)
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   939
            {
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   940
                Globals.Log("ReadConfigFromRegistry: Failure occured, " + ex.ToString());
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   941
            }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   942
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   943
            return;
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   944
        }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   945
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   946
    }
6234a0b9c6a8 Add PEPSettings class and move all add-in configuration into it.
Dean
parents:
diff changeset
   947
}