示例#1
0
 /// <summary>
 ///     Executes the action. This only happens if the Func's owner
 ///     is still alive.
 /// </summary>
 /// <returns>The result of the Func stored as reference.</returns>
 public TResult Execute()
 {
     if (StaticDelegate != null)
     {
         return(IsCustomTargetAlive
             ? StaticDelegate.Invoke()
             : default !);
示例#2
0
        /// <summary>
        ///     Executes the action. This only happens if the action's owner
        ///     is still alive.
        /// </summary>
        public void Execute()
        {
            if (StaticDelegate != null)
            {
                if (IsCustomTargetAlive)
                {
                    StaticDelegate.Invoke();
                }

                return;
            }

            TryExecuteWeakDelegate <object>();
        }