Class AttributeFetcher
Helper class (static method collection) that will fetch a given attribute from a type, or an instance of a type
Inherited Members
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public static class AttributeFetcher
Methods
FetchAttribute<AttributeClass>(object)
Fetch the first (if any) attribute of the given type from an instance of some source type
Declaration
public static AttributeClass FetchAttribute<AttributeClass>(object source) where AttributeClass : Attribute
Parameters
| Type | Name | Description |
|---|---|---|
| object | source | An instance of the type (class) to fetch the attribute from |
Returns
| Type | Description |
|---|---|
| AttributeClass | Attribute instance if present, otherwise null |
Type Parameters
| Name | Description |
|---|---|
| AttributeClass | The attribute to fetch |
FetchAttribute<AttributeClass>(Type)
Fetch the first (if any) attribute of the given type from some source type
Declaration
public static AttributeClass FetchAttribute<AttributeClass>(Type sourceType) where AttributeClass : Attribute
Parameters
| Type | Name | Description |
|---|---|---|
| Type | sourceType | The type (class) to fetch the attribute from |
Returns
| Type | Description |
|---|---|
| AttributeClass | Attribute instance if present, otherwise null |
Type Parameters
| Name | Description |
|---|---|
| AttributeClass | The attribute to fetch |