public ABase CreateAnswerFor(QBase question) { ABase a = question.CreateAnswer(_form); Answers[question] = a; return(a); }
private void OnChildIndexChange(QBase question, int oldIndex, int newIndex) { _children.RemoveAt(oldIndex); _children.Insert(newIndex, question); this.CacheIndexes(); }
public QBase(Form form, string title, QBase parent) { Title = title; Form = form; _parent = parent; _children = new List <QBase>(); }
private void OnChildParentChange(QBase question, QBase newParent) { question.SetParent(newParent); _children.Remove(question); this.CacheIndexes(); if (newParent != null) { newParent._children.Add(question); newParent.CacheIndexes(); } }
public bool Contains(QBase question) { if (question.Parent == null) { return(false); } else if (question.Parent == this) { return(true); } else { return(Contains(question.Parent)); } }
public ABase(QBase question) { _question = question; _creationTime = DateTime.UtcNow; }
public QRoot(Form form, string title, bool isRequired, QBase parent) : base(form, title, parent) { }
private void SetParent(QBase parent) { _parent = parent; }
public QBase AddANewQuestion(string type, string title, bool isRequired) { QBase q = (QBase)Activator.CreateInstance(Type.GetType(type), Form, title, isRequired, this); return(AddNewQuestionInternal(q)); }
public ABase FindAnswerFor(QBase question) { return(_answers[question]); }