comparison Source/TypeBuilder/Builders/FakeSetter.cs @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
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 }