System.Attribute.CopyToArrayList C# (CSharp) Method

CopyToArrayList() private static method

private static CopyToArrayList ( ArrayList attributeList, Attribute attributes, Hashtable types ) : void
attributeList ArrayList
attributes Attribute
types Hashtable
return void
        private static void CopyToArrayList(ArrayList attributeList,Attribute[] attributes,Hashtable types) 
        {
            for (int i = 0; i < attributes.Length; i++) 
            {
                attributeList.Add(attributes[i]);

                Type attrType = attributes[i].GetType();

                if (!types.Contains(attrType)) 
                    types[attrType] = InternalGetAttributeUsage(attrType);
            }
        }
        

Usage Example

Beispiel #1
0
        private static Attribute[] InternalGetCustomAttributes(EventInfo element, Type type, bool inherit)
        {
            Attribute[] attributes = (Attribute[])element.GetCustomAttributes(type, inherit);
            if (!inherit)
            {
                return(attributes);
            }
            Hashtable types         = new Hashtable(11);
            ArrayList attributeList = new ArrayList();

            Attribute.CopyToArrayList(attributeList, attributes, types);
            for (EventInfo parentDefinition = Attribute.GetParentDefinition(element); parentDefinition != null; parentDefinition = Attribute.GetParentDefinition(parentDefinition))
            {
                Attribute[] customAttributes = Attribute.GetCustomAttributes((MemberInfo)parentDefinition, type, false);
                Attribute.AddAttributesToList(attributeList, customAttributes, types);
            }
            return((Attribute[])attributeList.ToArray(type));
        }
All Usage Examples Of System.Attribute::CopyToArrayList