/// <summary> /// Add method to cache /// </summary> /// <param name="methodDefinitionType">The method definition type.</param> /// <param name="methodBase">Method base</param> private static void AddMethodToCache(CachedMethodDefinition methodDefinitionType, MethodBase methodBase) { _methodSignaturesCache[methodDefinitionType] = methodBase; }
public static MethodReference CreateMethodReference(AssemblyDefinition assemblyDefinition, CachedMethodDefinition methodDefinitionType) { MethodBase mb = null; if (_methodSignaturesCache.TryGetValue(methodDefinitionType, out mb)) { return(CreateMethodReference(assemblyDefinition, mb)); } else { throw new ILWeaverException(String.Format(CultureInfo.CurrentCulture, Properties.Resources.MethodSignatureNotFound, methodDefinitionType)); } }