예제 #1
0
 public IEnumerable <XunitAttributeInfo> GetCustomAttributes(Type attributeType)
 {
     foreach (IAttributeInfo attribute in target.GetAttributeInfos(Reflector.Wrap(attributeType), true))
     {
         yield return(new XunitAttributeInfoAdapter(attribute));
     }
 }
예제 #2
0
 /// <summary>
 /// Returns true if the code element has an attribute of the specified type.
 /// </summary>
 /// <param name="element">The code element.</param>
 /// <param name="attributeType">The attribute type.</param>
 /// <param name="inherit">If true, includes inherited attributes.</param>
 /// <returns>True if the code element has at least one attribute of the specified type.</returns>
 public static bool HasAttribute(ICodeElementInfo element, Type attributeType, bool inherit)
 {
     return(element.HasAttribute(Reflector.Wrap(attributeType), inherit));
 }