Example #1
0
        static void AddInternalsVisibleToAttr()
        {
            // raises attribute not imported error on write
            var ivt_t    = memRes.ReferenceOf(typeof(InternalsVisibleToAttribute)).Resolve();
            var ivt_ctor = ivt_t.Methods.First(md => (md.Attributes & (MethodAttributes.SpecialName | MethodAttributes.RTSpecialName)) != 0);

            context.PrimaryAssembly.CustomAttributes.Add(new CustomAttribute(ivt_ctor, Encoding.UTF8.GetBytes("Prism")));
        }
Example #2
0
 static void AddFieldForBHandler()
 {
     typeDef_Player.Fields.Add(new FieldDefinition("P_BHandler", FieldAttributes.Public, typeSys.Object));
     typeDef_Player.Fields.Add(new FieldDefinition("P_BuffBHandler", FieldAttributes.Public, memRes.ReferenceOf(typeof(object[]))));
 }
Example #3
0
 static void AddFieldForBHandler()
 {
     typeDef_Player.Fields.Add(new FieldDefUser("P_BHandler", new FieldSig(typeSys.Object), FieldAttributes.Public));
     typeDef_Player.Fields.Add(new FieldDefUser("P_BuffBHandler", new FieldSig(memRes.ReferenceOf(typeof(object[])).ToTypeSig()), FieldAttributes.Public));
 }