src/Misc/EFTools/XmlCore/Base/Context/ContextItemCollection.cs
/// <summary>
///     This is a helper method that returns the target object for a delegate.
///     If the delegate was created to proxy a generic delegate, this will correctly
///     return the original object, not the proxy.
/// </summary>
/// <param name="callback">The callback whose target you want.</param>
/// <exception cref="ArgumentNullException">if callback is null.</exception>
/// <returns>The target object of the callback.</returns>
This is a helper method that returns the target object for a delegate.
If the delegate was created to proxy a generic delegate, this will correctly
return the original object, not the proxy.
This is a helper method that returns the target object for a delegate . If the delegate was created to proxy a generic delegate this will correctly return the original object not the proxy .
protected static object GetTarget(Delegate callback)
        {
            if (callback == null)
            {
                throw new ArgumentNullException("callback");
            }
            var proxy = callback.Target as ICallbackProxy;
            if (proxy != null)
            {
                return proxy.OriginalTarget;
            }
            return callback.Target;
        }
protected static object GetTarget ( Delegate callback ) { if ( callback == null ) { throw new ArgumentNullException ( " " ) ; } var proxy = callback . Target as ICallbackProxy ; if ( proxy != null ) { return proxy . OriginalTarget ; } return callback . Target ; }
This is a helper method that returns the target object for a delegate.
This is a helper method that returns the target object for a delegate .
The target object of the callback.
The target object of the callback .
if callback is null.
if callback is null .
callback
Delegate
The callback whose target you want.
The callback whose target you want .