コード例 #1
0
 public AttributeSection(AttributeTarget attributeTarget,
     AttributeCollection attributes)
 {
     this.attributeTarget = attributeTarget;
     this.attributes = attributes;
 }
コード例 #2
0
 /// <summary>
 ///     <para>
 ///       Initializes a new instance of <see cref='.IAttributeCollection'/> based on another <see cref='.IAttributeCollection'/>.
 ///    </para>
 /// </summary>
 /// <param name='value'>
 ///       A <see cref='.IAttributeCollection'/> from which the contents are copied
 /// </param>
 public AttributeCollection(AttributeCollection value)
 {
     this.AddRange(value);
 }
コード例 #3
0
 public IAttributeEnumerator(AttributeCollection mappings)
 {
     this.temp = ((IEnumerable)(mappings));
     this.baseEnumerator = temp.GetEnumerator();
 }
コード例 #4
0
 /// <summary>
 ///     <para>
 ///       Adds the contents of another <see cref='.IAttributeCollection'/> to the end of the collection.
 ///    </para>
 /// </summary>
 /// <param name='value'>
 ///    A <see cref='.IAttributeCollection'/> containing the objects to add to the collection.
 /// </param>
 /// <returns>
 ///   <para>None.</para>
 /// </returns>
 /// <seealso cref='.IAttributeCollection.Add'/>
 public void AddRange(AttributeCollection value)
 {
     for (int i = 0; (i < value.Count); i = (i + 1)) {
         this.Add(value[i]);
     }
 }
コード例 #5
0
        public static AttributeCollection GetAssemblyAttributes(SharpAssembly_ assembly)
        {
            AttributeCollection attributes = new AttributeCollection();

            foreach (ArrayList al in assembly.Attributes.Assembly.Values) {
                foreach (SharpCustomAttribute attr in al) {
                    attributes.Add(new SharpAssemblyAttribute(assembly, attr));
                }
            }

            return attributes;
        }
コード例 #6
0
 AttributeSectionCollection VisitAttributes(ArrayList attributes)
 {
     // TODO Expressions???
     AttributeSectionCollection result = new AttributeSectionCollection();
     foreach (AST.AttributeSection section in attributes) {
         AttributeCollection resultAttributes = new AttributeCollection();
         foreach (AST.Attribute attribute in section.Attributes) {
             IAttribute a = new ASTAttribute(attribute.Name, new ArrayList(attribute.PositionalArguments), new SortedList());
             foreach (AST.NamedArgument n in attribute.NamedArguments) {
                 a.NamedArguments[n.Name] = n.Expr;
             }
         }
         IAttributeSection s = new AttributeSection((AttributeTarget)Enum.Parse(typeof (AttributeTarget), section.AttributeTarget), resultAttributes);
     }
     return null;
 }