Beispiel #1
0
        public MethodDefinition FindMethodBySignature(TypeReference typeRef, MethodReference methodToFind)
        {
            var genericInstanceType = typeRef as GenericInstanceType;
            if (genericInstanceType != null) {
                methodToFind = NormalizeMethod(genericInstanceType, methodToFind);
            }

            var methodToFindSig = methodToFind.GetMethodSignature();
            var methodToFindSigWithTypeName = methodToFind.GetMethodSignatureWithTypeName();

            foreach (var virtualMethod in this.methods) {
                var sig = virtualMethod.GetMethodSignature();
                if (sig == methodToFindSig ||
                    sig == methodToFindSigWithTypeName) {
                    return virtualMethod;
                }
            }

            return null;
        }