public override void ReadJson(JObject obj) { base.ReadJson(obj); if (obj["Name"] != null && ((JValue)obj["Name"]).Value != null) { Name = ((JValue)obj["Name"]).Value.ToString(); } if (obj["Deleted"] != null && ((JValue)obj["Deleted"]).Value != null) { Deleted = bool.Parse(((JValue)obj["Deleted"]).Value.ToString()); } if (obj["Questions"] != null) { JArray questionsObjs = JArray.FromObject(obj["Questions"]); if (questionsObjs != null) { this.Questions.Clear(); foreach (JObject cobj in questionsObjs) { QuestionTypes questionType = QuestionTypes.None; if (cobj["QuestionType"] != null && ((JValue)cobj["QuestionType"]).Value != null) { questionType = (QuestionTypes)Enum.Parse(typeof(QuestionTypes), ((JValue)cobj["QuestionType"]).Value.ToString()); } Question question = Questions.Add(questionType); question.ReadJson(cobj); } } } ObjectState = ObjectStates.None; SetOriginal(); }
public SubSection(DCAnalyticsObject parent) : base(parent) { Questions = new Questions(this); }
public Section(DCAnalyticsObject parent) : base(parent) { Questions = new Questions(this); SubSections = new SubSections(this); //Conditions = new SkipConditions(this); }