using System; using System.Linq; using System.Reflection; namespace Chernobyl.Attribution { /// /// An that is applied to methods. When executed, /// instances of this type will execute any /// types found on /// any parameters of the method attributed. /// [AttributeUsage(AttributeTargets.Method)] public class ProcessParametersAttribute : Attribute, IProcessAttribute { /// /// Performs the task requested on the /// passed in. /// /// The /// this was applied to and that is to be /// processed. /// public void Process(MethodInfo attributeProvider) { var parameters = attributeProvider.GetParameters().Concat( attributeProvider.ReturnParameter.ToEnumerable()); parameters.Process(Inherited); } /// /// True if this instance should look up the hierarchy chain of each /// for /// attributes. /// public bool Inherited { get; set; } } }