public static void ApplyTo(AssemblyBuilder assemblyBuilder, Dictionary <CacheKey, string> mappings) { using (var stream = new MemoryStream()) { var formatter = new BinaryFormatter(); formatter.Serialize(stream, mappings); var bytes = stream.ToArray(); var attributeBuilder = new CustomAttributeBuilder(constructor.AsConstructorInfo(), new object[] { bytes }); assemblyBuilder.SetCustomAttribute(attributeBuilder); } }
internal static IConstructorInfo GetConstructor(Type invocationType, IConstructorInfo constructor) { return TypeBuilder.GetConstructor(invocationType, constructor.AsConstructorInfo()).AsIConstructorInfo(); }
internal static IConstructorInfo GetConstructor(Type invocationType, IConstructorInfo constructor) { return(TypeBuilder.GetConstructor(invocationType, constructor.AsConstructorInfo()).AsIConstructorInfo()); }
public void InvokeBaseConstructor(IConstructorInfo constructor, params ArgumentReference[] arguments) { AddStatement( new ConstructorInvocationStatement(constructor.AsConstructorInfo(), ArgumentsUtil.ConvertArgumentReferenceToExpression(arguments))); }
public void InvokeBaseConstructor(IConstructorInfo constructor) { AddStatement(new ConstructorInvocationStatement(constructor.AsConstructorInfo())); }