Class ConstructorTypeCache
A thread-safe cache of constructors belonging to a given type.
Inherited Members
Namespace: Swan.Reflection
Syntax
public class ConstructorTypeCache : TypeCache<Tuple<ConstructorInfo, ParameterInfo[]>>
Properties
DefaultCache
Gets the default cache.
Declaration
public static Lazy<ConstructorTypeCache> DefaultCache { get; }
Property Value
Type | Description |
---|---|
Lazy<ConstructorTypeCache> | The default cache. |
Methods
RetrieveAllConstructors(Type, Boolean)
Retrieves all constructors order by the number of parameters ascending.
Declaration
public IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>> RetrieveAllConstructors(Type type, bool includeNonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type. |
Boolean | includeNonPublic | if set to |
Returns
Type | Description |
---|---|
IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>> | A collection with all the constructors in the given type. |
RetrieveAllConstructors<T>(Boolean)
Retrieves all constructors order by the number of parameters ascending.
Declaration
public IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>> RetrieveAllConstructors<T>(bool includeNonPublic = false)
Parameters
Type | Name | Description |
---|---|---|
Boolean | includeNonPublic | if set to |
Returns
Type | Description |
---|---|
IEnumerable<Tuple<ConstructorInfo, ParameterInfo[]>> | A collection with all the constructors in the given type. |
Type Parameters
Name | Description |
---|---|
T | The type to inspect. |