CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
DynamicMemberHandle.cs
Go to the documentation of this file.
1#if !IOS
2//-----------------------------------------------------------------------
3// <copyright file="DynamicMemberHandle.cs" company="Marimer LLC">
4// Copyright (c) Marimer LLC. All rights reserved.
5// Website: https://cslanet.com
6// </copyright>
7// <summary>no summary</summary>
8//-----------------------------------------------------------------------
9using System;
10using System.Collections.Generic;
11using System.Linq;
12using System.Text;
13using System.Reflection;
14
15namespace Csla.Reflection
16{
17 internal class DynamicMemberHandle
18 {
19 public string MemberName { get; private set; }
20 public Type MemberType { get; private set; }
21 public DynamicMemberGetDelegate DynamicMemberGet { get; private set; }
22 public DynamicMemberSetDelegate DynamicMemberSet { get; private set; }
23
24 //public string MemberFullName
25 //{
26 // get { return MemberType + "." + MemberName; }
27 //}
28
29 public DynamicMemberHandle(string memberName, Type memberType, DynamicMemberGetDelegate dynamicMemberGet, DynamicMemberSetDelegate dynamicMemberSet)
30 {
31 MemberName = memberName;
32 MemberType = memberType;
33 DynamicMemberGet = dynamicMemberGet;
34 DynamicMemberSet = dynamicMemberSet;
35 }
36
37 public DynamicMemberHandle(PropertyInfo info) :
38 this(
39 info.Name,
40 info.PropertyType,
41 DynamicMethodHandlerFactory.CreatePropertyGetter(info),
42 DynamicMethodHandlerFactory.CreatePropertySetter(info))
43 { }
44 public DynamicMemberHandle(FieldInfo info) :
45 this(
46 info.Name,
47 info.FieldType,
48 DynamicMethodHandlerFactory.CreateFieldGetter(info),
49 DynamicMethodHandlerFactory.CreateFieldSetter(info))
50 { }
51 }
52}
53#endif
delegate void DynamicMemberSetDelegate(object target, object arg)
Delegate for setting a value.
delegate object DynamicMemberGetDelegate(object target)
Delegate for getting a value.