public void AddAttribute(Attribute attribute, MemberInfo member)
MyClass c = new MyClass(); MyAttribute a = new MyAttribute("someValue"); Type type = c.GetType(); MemberInfo[] members = type.GetMembers(); foreach (MemberInfo m in members) { c.GetType().GetMethod("AddAttribute").Invoke(c, new object[] { a, m }); }This code creates an instance of MyClass, creates an instance of MyAttribute with a parameterized constructor, gets the type information for MyClass, gets the list of members for the class, and then loops through each member, adding the attribute to it. The package library for AddAttribute is System.Reflection.