Ejemplo n.º 1
0
        public static bool GetMightyVoidMethod(this BaseMightyMember mightyMember, object target, string memberName,
                                               CallbackSignature callbackSignature, out MightyVoidMethod method)
        {
            if (string.IsNullOrWhiteSpace(memberName))
            {
                method = null;
                return(false);
            }

            if (target is BaseWrapperAttribute wrapper && GetCallbackName(target, memberName, out var callbackName))
            {
                return(mightyMember.GetMightyVoidMethod(mightyMember.GetWrapperTarget(wrapper), callbackName, callbackSignature,
                                                        out method));
            }

            if (InternalGetMightyVoidMethod(target, memberName, callbackSignature, out method))
            {
                return(true);
            }

            if (!(mightyMember is MightySerializedField serializedField))
            {
                return(false);
            }

            target = serializedField.Property.GetPropertyTargetReference();
            return(target.GetType().GetCustomAttributes(typeof(SerializableAttribute), true).Length > 0 &&
                   InternalGetMightyVoidMethod(target, memberName, callbackSignature, out method));
        }