Beispiel #1
0
 public void AddSupertypingAdapter(TypeBuilder typeBuilder,
                                   TypeData adapteeType,
                                   Type adapterType)
 {
     Type[] paramTypes = new Type[] { typeof(Type), typeof(Type) };
     ConstructorInfo constructor =
         typeof(SupertypingAdapterAttribute).GetConstructor(paramTypes);
     object[] parameters = new object [] {
         adapteeType.RawType,
         adapterType
     };
     CustomAttributeBuilder attrBuilder =
         new CustomAttributeBuilder(constructor, parameters);
     typeBuilder.SetCustomAttribute(attrBuilder);
     Attribute attr =
         new SupertypingAdapterAttribute(adapteeType.RawType,
                                         adapterType);
     AddCustomAttribute(typeBuilder, attr);
 }