Exemplo n.º 1
0
        public IDataDefinition Clone()
        {
            var clone = new GroupDataDefinition();

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

            return clone;
        }
Exemplo n.º 2
0
        public IDataDefinition Clone()
        {
            GroupDataDefinition clone = new GroupDataDefinition();

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

            return(clone);
        }
Exemplo n.º 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");
            }
        }