public IDataDefinition Clone() { var clone = new GroupDataDefinition(); foreach (var member in Members) clone.Members.Add(member.Clone()); return clone; }
public IDataDefinition Clone() { GroupDataDefinition clone = new GroupDataDefinition(); foreach (IDataDefinition member in Members) { clone.Members.Add(member.Clone()); } return(clone); }
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"); } }