Ejemplo n.º 1
0
        public ABase CreateAnswerFor(QBase question)
        {
            ABase a = question.CreateAnswer(_form);

            Answers[question] = a;
            return(a);
        }
Ejemplo n.º 2
0
        private void OnChildIndexChange(QBase question, int oldIndex, int newIndex)
        {
            _children.RemoveAt(oldIndex);
            _children.Insert(newIndex, question);

            this.CacheIndexes();
        }
Ejemplo n.º 3
0
        public QBase(Form form, string title, QBase parent)
        {
            Title   = title;
            Form    = form;
            _parent = parent;

            _children = new List <QBase>();
        }
Ejemplo n.º 4
0
 private void OnChildParentChange(QBase question, QBase newParent)
 {
     question.SetParent(newParent);
     _children.Remove(question);
     this.CacheIndexes();
     if (newParent != null)
     {
         newParent._children.Add(question);
         newParent.CacheIndexes();
     }
 }
Ejemplo n.º 5
0
 public bool Contains(QBase question)
 {
     if (question.Parent == null)
     {
         return(false);
     }
     else if (question.Parent == this)
     {
         return(true);
     }
     else
     {
         return(Contains(question.Parent));
     }
 }
Ejemplo n.º 6
0
 public ABase(QBase question)
 {
     _question     = question;
     _creationTime = DateTime.UtcNow;
 }
Ejemplo n.º 7
0
 public QRoot(Form form, string title, bool isRequired, QBase parent)
     : base(form, title, parent)
 {
 }
Ejemplo n.º 8
0
 private void SetParent(QBase parent)
 {
     _parent = parent;
 }
Ejemplo n.º 9
0
        public QBase AddANewQuestion(string type, string title, bool isRequired)
        {
            QBase q = (QBase)Activator.CreateInstance(Type.GetType(type), Form, title, isRequired, this);

            return(AddNewQuestionInternal(q));
        }
Ejemplo n.º 10
0
 public ABase FindAnswerFor(QBase question)
 {
     return(_answers[question]);
 }