Example #1
0
 /// <summary>Creates a new <see cref="BplChangingEventArgs"/> instance.</summary>
 /// <param name="change">The change that is reported by this event.</param>
 internal BplChangingEventArgs(BplChange change) {
    Change = change;
 }
Example #2
0
      /// <summary>Invokes the trigger with the given change data.</summary>
      /// <param name="change">The trigger change data.</param>
      /// <returns><c>true</c> if the trigger was actually invoked, <c>false</c> otherwise.</returns>
      protected bool Invoke(BplChange change) {
         if (_disposed) return false;

         var targetObject = TargetObject;
         if (targetObject == null && _isInstanceHandler) {
            if (!_disposed) {
               if (Source != null) {
                  Source.Triggers.Remove(this);
               } else {
                  Dispose();
               }
            }
            return false;
         }

         if (_invoker == null) {
            _invoker = TargetMethod.CreateInvoker();
         }
         _invoker(targetObject, new[] { change });

         return true;
      }