예제 #1
0
파일: Dform.cs 프로젝트: gabrielhan/Dform
 public BaseAnswer FindAnswerFor(BaseQuestion bq)
 {
     BaseAnswer ba;
     _Answers.TryGetValue(bq, out ba);
     return ba;
 }
예제 #2
0
파일: Dform.cs 프로젝트: gabrielhan/Dform
 public bool HaveAncestor(BaseQuestion q)
 {
     if (this.Parent == q)
         return true;
     if (this.Parent is RootQuestion)
         return false;
     return this.Parent.HaveAncestor(q);
 }
예제 #3
0
파일: Dform.cs 프로젝트: gabrielhan/Dform
 public BaseAnswer AddAnswerFor(BaseQuestion bq)
 {
     BaseAnswer ba;
     _Answers.TryGetValue(bq, out ba);
     if (ba == null)
     {
         ba = (BaseAnswer)Activator.CreateInstance(bq.AnswerType);
         _Answers.Add(bq, ba);
     }
     return ba;
 }
예제 #4
0
파일: Dform.cs 프로젝트: gabrielhan/Dform
 public bool Contains(BaseQuestion q)
 {
     return q.HaveAncestor(this);
 }