Exemple #1
0
 protected object this[UserConfigurationPropertyId propertyID]
 {
     get
     {
         UserConfigurationPropertyDefinition propertyDefinition = this.Schema.GetPropertyDefinition(propertyID);
         object obj;
         if (this.OptionProperties.ContainsKey(propertyDefinition) && this.OptionProperties[propertyDefinition] != null)
         {
             obj = this.OptionProperties[propertyDefinition];
         }
         else
         {
             obj = propertyDefinition.GetValidatedProperty(null);
         }
         ExTraceGlobals.UserOptionsDataTracer.TraceDebug <string, object>((long)this.GetHashCode(), "Get property: '{0}'; value: '{1}'", propertyDefinition.PropertyName, obj);
         return(obj);
     }
     set
     {
         UserConfigurationPropertyDefinition propertyDefinition = this.Schema.GetPropertyDefinition(propertyID);
         object value2 = propertyDefinition.GetValidatedProperty(value);
         if (!this.OptionProperties.ContainsKey(propertyDefinition))
         {
             this.OptionProperties.Add(propertyDefinition, value2);
         }
         else
         {
             this.OptionProperties[propertyDefinition] = value2;
         }
         ExTraceGlobals.UserOptionsDataTracer.TraceDebug <string, object>((long)this.GetHashCode(), "Set property: '{0}'; value: '{1}'", propertyDefinition.PropertyName, this.OptionProperties[propertyDefinition]);
     }
 }
Exemple #2
0
 internal void Load(MailboxSession mailboxSession, IList <UserConfigurationPropertyDefinition> properties, bool ignoreOverQuotaException)
 {
     try
     {
         using (IReadableUserConfiguration readOnlyConfiguration = this.GetReadOnlyConfiguration(mailboxSession))
         {
             if (readOnlyConfiguration != null)
             {
                 IDictionary dictionary = readOnlyConfiguration.GetDictionary();
                 for (int i = 0; i < properties.Count; i++)
                 {
                     UserConfigurationPropertyDefinition userConfigurationPropertyDefinition = properties[i];
                     object originalValue = dictionary[userConfigurationPropertyDefinition.PropertyName];
                     this.optionProperties[userConfigurationPropertyDefinition] = userConfigurationPropertyDefinition.GetValidatedProperty(originalValue);
                     ExTraceGlobals.UserOptionsDataTracer.TraceDebug((long)this.GetHashCode(), "Loaded property: {0}", new object[]
                     {
                         this.optionProperties[userConfigurationPropertyDefinition]
                     });
                 }
             }
         }
     }
     catch (QuotaExceededException ex)
     {
         ExTraceGlobals.UserContextCallTracer.TraceDebug <string>(0L, "UserConfigurationBaseType: Load failed. Exception: {0}", ex.Message);
         if (!ignoreOverQuotaException)
         {
             throw;
         }
     }
 }