Class AttributeFetcher
Helper class (static method collection) that will fetch a given attribute from a type, or an instance of a type
Namespace: SuperOffice.Util
Assembly: SoCore.dll
Syntax
public static class AttributeFetcher : Object
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 |