Class PropertyInfoExtension
Extensions for PropertyInfo
Inheritance
System.Object
PropertyInfoExtension
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: Dapplo.ActiveDirectory.Extensions
Assembly: Dapplo.ActiveDirectory.dll
Syntax
public static class PropertyInfoExtension
Methods
| Improve this Doc View SourceGetAttribute<TAttribute>(MemberInfo, Boolean, Boolean)
Retrieve an attribute from a property
Declaration
public static TAttribute GetAttribute<TAttribute>(this MemberInfo memberInfo, bool inherit = true, bool includeInterfaces = true)
where TAttribute : Attribute
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | memberInfo | MemberInfo |
System.Boolean | inherit | bool default true to also check inherit class attributes |
System.Boolean | includeInterfaces | bool default true if the interfaces of the declaring type also need to be checked |
Returns
Type | Description |
---|---|
TAttribute | TAttribute or null |
Type Parameters
Name | Description |
---|---|
TAttribute | Type of the attribute |
GetAttributes<TAttribute>(MemberInfo, Boolean, Boolean)
Retrieve attributes from a property
Declaration
public static IEnumerable<TAttribute> GetAttributes<TAttribute>(this MemberInfo memberInfo, bool inherit = true, bool includeInterfaces = true)
where TAttribute : Attribute
Parameters
Type | Name | Description |
---|---|---|
System.Reflection.MemberInfo | memberInfo | MemberInfo |
System.Boolean | inherit | bool default true to also check inherit class attributes |
System.Boolean | includeInterfaces | bool default true if the interfaces of the declaring type also need to be checked |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TAttribute> | IEnumerable of TAttribute |
Type Parameters
Name | Description |
---|---|
TAttribute | Type of the attribute |