Skip to content

Commit 37eeb3c

Browse files
committed
Introduced new ParameterMetadata class
With the abstract `ItemMetadata` in place (bec7123), we can now create a new `ParameterMetadata` class, which shares a number of properties with the existing `MemberAccessor` class. This will, eventually, allow the `ItemConfiguration` to accept an `ItemMetadata` class for _either_ parameters _or_ properties, thus giving it access to more configuration data than simply `CustomAttributes`, as it has today. Ultimately, this will prevent us from needing to dynamically check e.g. `IsCompatible` and `IsList` by allowing those values to be added and cached as part of `ItemMetadata.
1 parent bec7123 commit 37eeb3c

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*==============================================================================================================================
2+
| Author Ignia, LLC
3+
| Client Ignia, LLC
4+
| Project Topics Library
5+
\=============================================================================================================================*/
6+
using System.Reflection;
7+
8+
namespace OnTopic.Internal.Reflection {
9+
10+
/*============================================================================================================================
11+
| CLASS: PARAMETER METADATA
12+
\---------------------------------------------------------------------------------------------------------------------------*/
13+
/// <summary>
14+
/// Provides metadata associated with a given parameter.
15+
/// </summary>
16+
internal class ParameterMetadata: ItemMetadata {
17+
18+
/*==========================================================================================================================
19+
| CONSTRUCTOR
20+
\-------------------------------------------------------------------------------------------------------------------------*/
21+
/// <summary>
22+
/// Initializes a new instance of the <see cref="ParameterMetadata"/> class associated with a <see cref="ParameterInfo"/>
23+
/// instance.
24+
/// </summary>
25+
/// <param name="parameterInfo">The <see cref="ParameterInfo"/> associated with this instance.</param>
26+
internal ParameterMetadata(ParameterInfo parameterInfo): base (parameterInfo.Name, parameterInfo) {
27+
ParameterInfo = parameterInfo;
28+
Type = parameterInfo.ParameterType;
29+
}
30+
31+
/*==========================================================================================================================
32+
| PARAMETER INFO
33+
\-------------------------------------------------------------------------------------------------------------------------*/
34+
/// <summary>
35+
/// Gets the <see cref="ParameterInfo"/> associated with this instance of <see cref="ParameterMetadata"/>.
36+
/// </summary>
37+
public ParameterInfo ParameterInfo { get; }
38+
39+
} //Class
40+
} //Namespace

0 commit comments

Comments
 (0)