コード例 #1
0
 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);
     }
 }
コード例 #2
0
 internal static IConstructorInfo GetConstructor(Type invocationType, IConstructorInfo constructor)
 {
     return TypeBuilder.GetConstructor(invocationType, constructor.AsConstructorInfo()).AsIConstructorInfo();
 }
コード例 #3
0
ファイル: ConstructorFactory.cs プロジェクト: rajgit31/MoqRT
 internal static IConstructorInfo GetConstructor(Type invocationType, IConstructorInfo constructor)
 {
     return(TypeBuilder.GetConstructor(invocationType, constructor.AsConstructorInfo()).AsIConstructorInfo());
 }
コード例 #4
0
 public void InvokeBaseConstructor(IConstructorInfo constructor, params ArgumentReference[] arguments)
 {
     AddStatement(
         new ConstructorInvocationStatement(constructor.AsConstructorInfo(),
                                            ArgumentsUtil.ConvertArgumentReferenceToExpression(arguments)));
 }
コード例 #5
0
 public void InvokeBaseConstructor(IConstructorInfo constructor)
 {
     AddStatement(new ConstructorInvocationStatement(constructor.AsConstructorInfo()));
 }