Class AttributeCache
A static class that caches attributes for types.
Inheritance
System.Object
AttributeCache
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: SpiceSharp.Reflection
Assembly: SpiceSharp.dll
Syntax
public static class AttributeCache
Methods
GetAttributes(Type)
Gets the attributes.
Declaration
public static IEnumerable<Attribute> GetAttributes(Type type)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<System.Attribute> | The attributes for a type. |
GetAttributes<T>(Type)
Gets the attributes.
Declaration
public static IEnumerable<T> GetAttributes<T>(Type type)
where T : Attribute
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IEnumerable<T> | The attributes for a type of the specified attribute type. |
Type Parameters
| Name | Description |
|---|---|
| T | The base attribute type. |