Пример #1
0
 internal TypeReference CreateReference()
 {
     return(new TypeReference(@namespace, name, module, scope)
     {
         DeclaringType = declaring_type != null?declaring_type.CreateReference() : null,
     });
 }
        public static CustomAttribute GetExportedTypeAttribute(ExportedType exportedType, ModuleDefinition module)
        {
            MethodReference ctor = Utilities.GetEmptyConstructor(typeof(System.Runtime.CompilerServices.TypeForwardedToAttribute), module, new[] { typeof(System.Type) });

            CustomAttribute exportedTypeAttribute = new CustomAttribute(ctor);
            TypeReference   systemType            = Utilities.GetCorlibTypeReference(typeof(Type), module);
            TypeReference   type = exportedType.CreateReference();

            exportedTypeAttribute.ConstructorArguments.Add(new CustomAttributeArgument(systemType, type));

            return(exportedTypeAttribute);
        }