예제 #1
0
        public IDataDefinition Clone()
        {
            var clone = new GroupDataDefinition();

            foreach (var member in Members)
                clone.Members.Add(member.Clone());

            return clone;
        }
예제 #2
0
        public IDataDefinition Clone()
        {
            GroupDataDefinition clone = new GroupDataDefinition();

            foreach (IDataDefinition member in Members)
            {
                clone.Members.Add(member.Clone());
            }

            return(clone);
        }
예제 #3
0
        public static IDataDefinition FromJson(JToken obj)
        {
            var type = (string)obj["type"];

            if (type == null)
            {
                return(SingleDataDefinition.FromJson(obj));
            }
            else if (type == "group")
            {
                return(GroupDataDefinition.FromJson(obj));
            }
            else if (type == "repeat")
            {
                return(RepeatDataDefinition.FromJson(obj));
            }
            else
            {
                throw new ArgumentException("Invalid definition type.", "obj");
            }
        }