Retrieves a custom attribute of a specified type that is applied to a specified member. The type of attribute to search for. A custom attribute that matches type, or if no such attribute is found.
(Type type)
| 602 | /// <param name="type">The type of attribute to search for.</param> |
| 603 | /// <returns>A custom attribute that matches type, or <see langword="null" /> if no such attribute is found.</returns> |
| 604 | public object GetAttribute(Type type) |
| 605 | { |
| 606 | var attr = GetAttributes(true); |
| 607 | for (int i = 0; i < attr.Length; i++) |
| 608 | { |
| 609 | if (attr[i].GetType() == type) |
| 610 | return attr[i]; |
| 611 | } |
| 612 | return null; |
| 613 | } |
| 614 | |
| 615 | /// <summary> |
| 616 | /// Retrieves a custom attribute of a specified type that is applied to a specified member. |
no test coverage detected