ParameterSignature Class
Definition
- Namespace
- Cuemon.Reflection
- Assemblies
- Cuemon.Core.dll
Represent the signature of a parameter to a method, property or similar.
public sealed class ParameterSignature
- Inheritance
-
objectParameterSignature
Examples
The following example demonstrates how to use
using System;
using System.Linq;
using System.Reflection;
using Cuemon.Reflection;
namespace MyApp.Examples;
public class ParameterSignatureExample
{
public void Demonstrate()
{
MethodInfo method = typeof(string).GetMethod("IndexOf", new[] { typeof(string), typeof(StringComparison) });
if (method != null)
{
var signatures = ParameterSignature.Parse(method).ToList();
foreach (var signature in signatures)
{
Console.WriteLine($"Parameter: {signature.ParameterName}, Type: {signature.ParameterType.Name}");
}}}
}
Constructors
| Name | Description |
|---|---|
| ParameterSignature(Type, string) | Initializes a new instance of the ParameterSignature class. |
Properties
| Name | Description |
|---|---|
| ParameterName | Gets the name of the parameter. |
| ParameterType | Gets the Type of the parameter. |
Methods
| Name | Description |
|---|---|
| Parse(IEnumerable<ParameterInfo>) | Converts the specified ParameterInfo sequence to its IEnumerable<T> equivalent. |
| Parse(MethodBase) | Extracts and converts the ParameterInfo sequence to its IEnumerable<T> equivalent from GetParameters(). |