コード例 #1
0
 /// <summary>
 /// Tests whether a type is decorated with a <see cref="FeatherAttribute"/> for
 /// the given <see cref="FeatherAction"/>.
 /// </summary>
 /// <param name="type">The type to test.</param>
 /// <param name="action">The action to test for.</param>
 /// <returns><code>true</code> if the passed type is decorated with
 /// a feather attribute for the passed action.</returns>
 public static bool HasFeatherAttribute(this TypeDefinition type, FeatherAction action)
 {
     return((from attr in type.CustomAttributes
             where attr.AttributeType.Is <FeatherAttribute>() &&
             Object.Equals(attr.ConstructorArguments.First().Value, (int)action)
             select attr)
            .Any());
 }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="FeatherAttribute"/> class.
 /// </summary>
 /// <param name="action">The action to execute on the decorated code element.</param>
 public FeatherAttribute(FeatherAction action)
 {
     this.action = action;
 }