public void After()
        {
            if (!(Invocation.GetArgumentValue(0) is INotifyPropertyChanged))
            {
                return;
            }
            if (Invocation.GetArgumentValue(0) == null)
            {
                return;
            }

            AddHandler(Invocation, NotifiedObject);
        }
Beispiel #2
0
        public void Intercept()
        {
            var oldValue = Invocation.GetCurrentValue();

            Invocation.Proceed();
            var newValue = Invocation.GetArgumentValue(0);

            if (AreEqual(oldValue, newValue))
            {
                return;
            }

            NotifiedObject.Notify(Invocation);
        }
Beispiel #3
0
 /// <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));
 }
Beispiel #4
0
        public void Intercept()
        {
            var onPropertyChanged = (PropertyChangedEventHandler)Invocation.GetArgumentValue(0);

            NotifiedObject.PropertyChanged += onPropertyChanged;
        }