예제 #1
0
 private object this[UserOptionPropertySchema.UserOptionPropertyID propertyID]
 {
     get
     {
         UserOptionPropertyDefinition propertyDefinition = UserOptionPropertySchema.GetPropertyDefinition(propertyID);
         object obj;
         if (this.optionProperties.ContainsKey(propertyDefinition) && this.optionProperties[propertyDefinition] != null)
         {
             obj = this.optionProperties[propertyDefinition].Value;
         }
         else
         {
             obj = propertyDefinition.GetValidatedProperty(null);
         }
         ExTraceGlobals.UserOptionsDataTracer.TraceDebug <string, object>((long)this.GetHashCode(), "Get property: '{0}'; value: '{1}'", propertyDefinition.PropertyName, obj);
         return(obj);
     }
     set
     {
         UserOptionPropertyDefinition        propertyDefinition      = UserOptionPropertySchema.GetPropertyDefinition(propertyID);
         UserOptions.UserOptionPropertyValue userOptionPropertyValue = new UserOptions.UserOptionPropertyValue(propertyDefinition.GetValidatedProperty(value), true);
         if (!this.optionProperties.ContainsKey(propertyDefinition))
         {
             this.optionProperties.Add(propertyDefinition, userOptionPropertyValue);
             this.isSynced = false;
             ExTraceGlobals.UserOptionsDataTracer.TraceDebug <string, object>((long)this.GetHashCode(), "Set property: '{0}'; value: '{1}'", propertyDefinition.PropertyName, this.optionProperties[propertyDefinition].Value);
             return;
         }
         if (this.optionProperties[propertyDefinition] == null || !userOptionPropertyValue.Value.Equals(this.optionProperties[propertyDefinition].Value))
         {
             this.optionProperties[propertyDefinition] = userOptionPropertyValue;
             this.isSynced = false;
             ExTraceGlobals.UserOptionsDataTracer.TraceDebug <string, object>((long)this.GetHashCode(), "Set property: '{0}'; value: '{1}'", propertyDefinition.PropertyName, this.optionProperties[propertyDefinition].Value);
         }
     }
 }
예제 #2
0
 internal static UserOptionPropertyDefinition GetPropertyDefinition(UserOptionPropertySchema.UserOptionPropertyID id)
 {
     return(UserOptionPropertySchema.GetPropertyDefinition((int)id));
 }