예제 #1
0
 public static ObjectMeta FromPath(object root, string rootName, IEnumerable<string> path)
 {
     var current = new ObjectMeta(root, rootName);
     foreach (var memberName in path)
     {
         var member = current.GetMember(memberName);
         if (member == null)
         {
             throw new Exception(string.Format("Unknown member '{0}'", memberName));
         }
         current = member;
     }
     return current;
 }
예제 #2
0
        public static ObjectMeta FromPath(object root, string rootName, IEnumerable <string> path)
        {
            var current = new ObjectMeta(root, rootName);

            foreach (var memberName in path)
            {
                var member = current.GetMember(memberName);
                if (member == null)
                {
                    throw new Exception(string.Format("Unknown member '{0}'", memberName));
                }
                current = member;
            }
            return(current);
        }