示例#1
0
 public void AddQuestion(Question question)
 {
     XDocument xDocument = XDocument.Load(_configFilePath);
     var questionsNode = xDocument.Element("questions");
     if (questionsNode == null || !questionsNode.HasElements)
         return;
     XNode node = new XElement();
     questionsNode.Add();
 }
示例#2
0
 public void DeleteQuestion(Question question)
 {
     XDocument xDocument = XDocument.Load(_configFilePath);
     var questionsNode = xDocument.Element("questions");
     if (questionsNode == null || !questionsNode.HasElements)
         return;
     var element = questionsNode.XPathSelectElement(string.Format("//question[@id='{0}']", question.Id));
     element.Remove();
     xDocument.Save(_configFilePath);
 }
示例#3
0
        public void EditQuestion(Question question)
        {
            XDocument xDocument = XDocument.Load(_configFilePath);
            var questionsNode = xDocument.Element("questions");
            if (questionsNode == null || !questionsNode.HasElements)
                return;

            var element = questionsNode.XPathSelectElement(string.Format("//question[@id='{0}']", question.Id));
            if (element == null)
                return;
            element.SetElementValue("text", question.Text);
            xDocument.Save(_configFilePath);
        }
 internal QuestionUserControl(Question question)
     : this()
 {
     Question = question;
 }
 internal QuestionEventArgs(Question question)
 {
     Question = question;
 }
 internal QuestionMoveEventArgs(Question question, Direction direction)
 {
     Question = question;
     Direction = direction;
 }