public void After() { if (!(Invocation.GetArgumentValue(0) is INotifyPropertyChanged)) { return; } if (Invocation.GetArgumentValue(0) == null) { return; } AddHandler(Invocation, NotifiedObject); }
public void Intercept() { var oldValue = Invocation.GetCurrentValue(); Invocation.Proceed(); var newValue = Invocation.GetArgumentValue(0); if (AreEqual(oldValue, newValue)) { return; } NotifiedObject.Notify(Invocation); }
/// <summary> /// Gets the value of the argument at the specified index. /// </summary> /// <param name="index">The index.</param> /// <returns> /// Value of the argument. /// </returns> public object GetArgumentValue(int index) { return(Invocation.GetArgumentValue(index)); }
public void Intercept() { var onPropertyChanged = (PropertyChangedEventHandler)Invocation.GetArgumentValue(0); NotifiedObject.PropertyChanged += onPropertyChanged; }