Class AssemblyExtensions
Extensions various for Assembly objects.
Inherited Members
Namespace: TheXDS.MCART.Types.Extensions
Assembly: MCART.dll
Syntax
public static class AssemblyExtensions
Methods
| Edit this page View SourceGetAttribute<T>(Assembly)
Gets the attribute associated with the specified assembly.
Declaration
public static T? GetAttribute<T>(this Assembly assembly) where T : Attribute
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly | The Assembly from which the attribute will be extracted. |
Returns
Type | Description |
---|---|
T | An attribute of the type |
Type Parameters
Name | Description |
---|---|
T | Type of the attribute to return. Must inherit from Attribute. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
GetAttributes<T>(Assembly)
Gets the attribute associated with the specified assembly.
Declaration
public static IEnumerable<T> GetAttributes<T>(this Assembly assembly) where T : Attribute
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly | The Assembly from which the attribute will be extracted. |
Returns
Type | Description |
---|---|
IEnumerable<T> | An attribute of the type |
Type Parameters
Name | Description |
---|---|
T | Type of the attribute to return. Must inherit from Attribute. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown if |
HasAttrValue<TAttribute, TValue>(Assembly, out TValue)
Determines if a member possesses a defined attribute.
Declaration
public static bool HasAttrValue<TAttribute, TValue>(this Assembly assembly, out TValue value) where TAttribute : Attribute, IValueAttribute<TValue>
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly | Member from which the attribute will be extracted. |
TValue | value | Out parameter. If an attribute of type
|
Returns
Type | Description |
---|---|
bool | true if the member possesses the attribute, false otherwise. |
Type Parameters
Name | Description |
---|---|
TAttribute | Type of the attribute to search for. Must inherit from Attribute and from IValueAttribute<T>. |
TValue | Type of the value to return. |
HasAttribute<T>(Assembly)
Determines if a member possesses a defined attribute.
Declaration
public static bool HasAttribute<T>(this Assembly assembly) where T : Attribute
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly | Member from which the attribute will be extracted. |
Returns
Type | Description |
---|---|
bool | true if the member possesses the attribute, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Type of the attribute to return. Must inherit from Attribute. |
HasAttribute<T>(Assembly, out T?)
Determines if a member possesses a defined attribute.
Declaration
public static bool HasAttribute<T>(this Assembly assembly, out T? attribute) where T : notnull, Attribute
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly | Member from which the attribute will be extracted. |
T | attribute | Out parameter. If an attribute of type
|
Returns
Type | Description |
---|---|
bool | true if the member possesses the attribute, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Type of the attribute to return. Must inherit from Attribute. |
HasAttributes<T>(Assembly, out IEnumerable<T>)
Determines if a member possesses a defined attribute.
Declaration
public static bool HasAttributes<T>(this Assembly assembly, out IEnumerable<T> attribute) where T : Attribute
Parameters
Type | Name | Description |
---|---|---|
Assembly | assembly | Member from which the attribute will be extracted. |
IEnumerable<T> | attribute | Out parameter. If an attribute of type
|
Returns
Type | Description |
---|---|
bool | true if the member possesses the attribute, false otherwise. |
Type Parameters
Name | Description |
---|---|
T | Type of the attribute to return. Must inherit from Attribute. |