alielie
2026-09-10 f3889f2d36c50cf99468594854def9b7ed069fb5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using System.Globalization;
using System.Reflection;
 
namespace DynamicExpresso.Reflection
{
    /// <summary>
    /// A simple implementation of <see cref="MethodBase"/> that only provides the method signature (ie. the parameter types).
    /// </summary>
    internal class SimpleMethodSignature : MethodBase
    {
        private class SimpleParameterInfo : ParameterInfo
        {
            public SimpleParameterInfo(Type parameterType)
            {
                ClassImpl = parameterType;
                DefaultValueImpl = null;
            }
 
            public override bool HasDefaultValue => false;
        }
 
        public override MethodAttributes Attributes { get; } = MethodAttributes.Public;
        public override MemberTypes MemberType { get; } = MemberTypes.Method;
 
        private readonly ParameterInfo[] _parameterInfos;
        public SimpleMethodSignature(params Type[] parameterTypes)
        {
            _parameterInfos = new ParameterInfo[parameterTypes.Length];
            for (var i = 0; i < parameterTypes.Length; i++)
            {
                _parameterInfos[i] = new SimpleParameterInfo(parameterTypes[i]);
            }
        }
 
        public override ParameterInfo[] GetParameters()
        {
            return _parameterInfos;
        }
 
        public override RuntimeMethodHandle MethodHandle => throw new NotImplementedException();
        public override string Name => throw new NotImplementedException();
        public override Type DeclaringType => throw new NotImplementedException();
        public override Type ReflectedType => throw new NotImplementedException();
 
        public override object[] GetCustomAttributes(bool inherit)
        {
            throw new NotImplementedException();
        }
 
        public override object[] GetCustomAttributes(Type attributeType, bool inherit)
        {
            throw new NotImplementedException();
        }
 
        public override MethodImplAttributes GetMethodImplementationFlags()
        {
            throw new NotImplementedException();
        }
 
        public override object Invoke(object obj, BindingFlags invokeAttr, Binder binder, object[] parameters, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
 
        public override bool IsDefined(Type attributeType, bool inherit)
        {
            throw new NotImplementedException();
        }
    }
}