/// <summary>
 /// Called when a property <c>set</c> method is intercepted and executes before the method body.
 /// </summary>
 /// <param name="e">The interception event arguments.</param>
 /// <remarks>
 /// The value of the <see cref="PropertyInterceptionArgs.Value" /> property will be populated with the
 /// updated value which has been assigned during the set operation.
 /// </remarks>
 public virtual void OnSet(PropertyInterceptionArgs e) => Validate(e.Property.Name, e.Property.PropertyType, e.Value);
 /// <summary>
 /// Called when a property <c>set</c> method is invoked and has produced an unhandled exception.
 /// </summary>
 /// <param name="e">The interception event arguments.</param>
 /// <param name="ex">The intercepted exception.</param>
 public virtual void OnException(PropertyInterceptionArgs e, Exception ex) => throw ex;
 /// <summary>
 /// Called when a property <c>set</c> method is intercepted and executes after the method body.
 /// </summary>
 /// <param name="e">The interception event arguments.</param>
 public virtual void OnExit(PropertyInterceptionArgs e)
 {
 }
Example #4
0
 /// <summary>
 /// Called when a property <c>set</c> method is intercepted and executes before the method body.
 /// </summary>
 /// <param name="e">The interception event arguments.</param>
 /// <remarks>
 /// The value of the <see cref="P:Mimick.Aspect.PropertyInterceptionArgs.Value" /> property will be populated with the
 /// updated value which has been assigned during the set operation.
 /// </remarks>
 public virtual void OnSet(PropertyInterceptionArgs e) => e.Value = Apply(e.Value, e.Property.PropertyType);