Beispiel #1
0
 public ReflectionInvoker(Type type, string name)
 {
     Name       = name;
     List       = TypeHelper.GetMemberInfoList(type, name);
     Last       = List.Last();
     DataType   = TypeHelper.GetMemberType(Last);
     TargetType = type;
 }
Beispiel #2
0
        public static string Get(Type type, string name, string separator)
        {
            var builder = new StringBuilder();

            foreach (var info in TypeHelper.GetMemberInfoList(type, name))
            {
                builder.Append(Get(GetTypeCategory(type), info.Info.Name));
                builder.Append(separator);
            }
            builder.Length -= separator.Length;
            return(builder.ToString());
        }
Beispiel #3
0
 public static IInvoker Initialize(Type type, string property)
 {
     if (property == null)
         return null;
     var list = TypeHelper.GetMemberInfoList(type, property);
     if (list.Count == 1)
     {
         return Initialize(list[0].Info, list[0].Index == null, list[0].Index);
     }
     if (list.Count > 1)
     {
         var last = list.Last();
         var emittype = typeof(ComplexInvoker<,>).MakeGenericType(type, TypeHelper.GetMemberType(last.Info));
         return (IInvoker)CreateObject(emittype, new[] { typeof(string), typeof(List<MemberParseInfo>) }, new object[] { property, list }, true);
     }
     return null;
 }
Beispiel #4
0
 public ComplexInvoker(string property)
     : this(property, TypeHelper.GetMemberInfoList(typeof(T), property))
 {
 }