Пример #1
0
 public override void SetValue(T instance, V value)
 {
     if (_dset != null)
     {
         _dset.Invoke(instance, value);
     }
     else
     {
         _field.SetValue(instance, value);
     }
 }
Пример #2
0
 /// <summary>
 /// Sets the value of the property of the
 /// supplied instance
 /// </summary>
 /// <param name="instance">An object instance, whose
 /// property value will be set</param>
 /// <param name="value">A value to set</param>
 public override void SetValue(T instance, V value)
 {
     if (_dset != null)
     {
         _dset.Invoke(instance, value);
     }
     else
     {
         if (_property.CanWrite)
         {
             _property.SetValue(instance, value, null);
         }
         else
         {
             throw Error.PropertyIsReadOnly(_property);
         }
     }
 }