0
|
1 using System;
|
|
2 using System.Reflection;
|
|
3
|
|
4 namespace BLToolkit.TypeBuilder.Builders
|
|
5 {
|
|
6 class FakeSetter : FakeMethodInfo
|
|
7 {
|
|
8 public FakeSetter(PropertyInfo propertyInfo)
|
|
9 : base(propertyInfo, propertyInfo.GetGetMethod(true))
|
|
10 {
|
|
11 }
|
|
12
|
|
13 public override ParameterInfo[] GetParameters()
|
|
14 {
|
|
15 var index = _property.GetIndexParameters();
|
|
16 var pi = new ParameterInfo[index.Length + 1];
|
|
17
|
|
18 index.CopyTo(pi, 0);
|
|
19 pi[index.Length] = new FakeParameterInfo("value", _property.PropertyType, _property, null);
|
|
20
|
|
21 return pi;
|
|
22 }
|
|
23
|
|
24 public override string Name
|
|
25 {
|
|
26 get { return "set_" + _property.Name; }
|
|
27 }
|
|
28
|
|
29 public override Type ReturnType
|
|
30 {
|
|
31 get { return typeof(void); }
|
|
32 }
|
|
33 }
|
|
34 }
|