System.ComponentModel.MemberDescriptor.GetInvocationTarget C# (CSharp) Method

GetInvocationTarget() protected method

This method returns the object that should be used during invocation of members. Normally the return value will be the same as the instance passed in. If someone associated another object with this instance, or if the instance is a custom type descriptor, GetInvocationTarget may return a different value.
protected GetInvocationTarget ( Type type, object instance ) : object
type Type
instance object
return object
        protected virtual object GetInvocationTarget(Type type, object instance)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            if (instance == null)
            {
                throw new ArgumentNullException(nameof(instance));
            }

            return TypeDescriptor.GetAssociation(type, instance);
        }