Class ReflectionAttributeProvider
Provides methods to get attributes from a System.Type, System.Reflection.MemberInfo, System.Reflection.ParameterInfo or System.Reflection.Assembly.
Inheritance
Implements
Inherited Members
Namespace: Bayat.Json.Serialization
Assembly: Bayat.Json.Runtime.dll
Syntax
public class ReflectionAttributeProvider : IAttributeProvider
Constructors
| Improve this Doc View SourceReflectionAttributeProvider(Object)
Initializes a new instance of the ReflectionAttributeProvider class.
Declaration
public ReflectionAttributeProvider(object attributeProvider)
Parameters
Type | Name | Description |
---|---|---|
System.Object | attributeProvider | The instance to get attributes for. This parameter should be a System.Type, System.Reflection.MemberInfo, System.Reflection.ParameterInfo or System.Reflection.Assembly. |
Methods
| Improve this Doc View SourceGetAttributes(Boolean)
Returns a collection of all of the attributes, or an empty collection if there are no attributes.
Declaration
public IList<Attribute> GetAttributes(bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | inherit | When true, look up the hierarchy chain for the inherited custom attribute. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Attribute> | A collection of System.Attributes, or an empty collection. |
GetAttributes(Type, Boolean)
Returns a collection of attributes, identified by type, or an empty collection if there are no attributes.
Declaration
public IList<Attribute> GetAttributes(Type attributeType, bool inherit)
Parameters
Type | Name | Description |
---|---|---|
System.Type | attributeType | The type of the attributes. |
System.Boolean | inherit | When true, look up the hierarchy chain for the inherited custom attribute. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<System.Attribute> | A collection of System.Attributes, or an empty collection. |