public static IEnumerable <IExtractionProduct> Populate(Context cx, IExtractedEntity @object, CustomAttributeHandleCollection attributes)
 {
     foreach (var attrib in attributes)
     {
         yield return(new Attribute(cx, @object, attrib));
     }
 }
Beispiel #2
0
 /// <summary>
 /// Extract the contents of a given entity.
 /// </summary>
 /// <param name="entity">The entity to extract.</param>
 public void Extract(IExtractedEntity entity)
 {
     foreach (var content in entity.Contents)
     {
         content.Extract(this);
     }
 }
 public Attribute(Context cx, IExtractedEntity @object, CustomAttributeHandle handle) : base(cx)
 {
     attrib       = cx.MdReader.GetCustomAttribute(handle);
     this.handle  = handle;
     this.@object = @object;
 }
 internal static Tuple metadata_handle(IExtractedEntity entity, Assembly assembly, int handleValue) =>
 new Tuple("metadata_handle", entity, assembly, handleValue);
 internal static Tuple cil_type_annotation(IExtractedEntity receiver, TypeAnnotation annotation) =>
 new Tuple("cil_type_annotation", receiver, (int)annotation);
 internal static Tuple cil_attribute(Attribute attribute, IExtractedEntity @object, Method constructor) =>
 new Tuple("cil_attribute", attribute, @object, constructor);
 internal static Tuple cil_access(Instruction i, IExtractedEntity m) =>
 new Tuple("cil_access", i, m);