示例#1
0
 public EwsStoreObjectPropertyDefinition(string name, ExchangeObjectVersion versionAdded, Type type, PropertyDefinitionFlags flags, object defaultValue, object initialValue, PropertyDefinitionBase storePropertyDefinition, Action <Item, object> itemPropertySetter) : base(name, versionAdded ?? EwsHelper.EwsVersionToExchangeObjectVersion(storePropertyDefinition.Version), type, flags, defaultValue, initialValue)
 {
     if (storePropertyDefinition == null)
     {
         throw new ArgumentNullException("storePropertyDefinition");
     }
     if (storePropertyDefinition is PropertyDefinition)
     {
         if (itemPropertySetter == null && !this.IsReadOnly && storePropertyDefinition != ItemSchema.Attachments)
         {
             throw new ArgumentException("ItemPropertySetter must be provided for writable first class property.");
         }
     }
     else if (storePropertyDefinition is ExtendedPropertyDefinition && itemPropertySetter != null)
     {
         throw new ArgumentException("ItemPropertySetter shouldn't be provided for extended property.");
     }
     this.storePropertyDefinition = storePropertyDefinition;
     this.ItemPropertySetter      = itemPropertySetter;
 }