コード例 #1
0
 private static void WriteDisambiguationQuestion(XmlWriter xw, DisambiguationQuestion childNode)
 {
     xw.WriteStartElement("DisambiguationQuestion");
     WriteDialogNodeProperties(xw, childNode);
     xw.WriteElementString("Message", childNode.QuestionExpression);
     xw.WriteComment(childNode.QuestionText);
     if (childNode.DisambiguationOptions != null && childNode.DisambiguationOptions.Count > 0)
     {
         xw.WriteStartElement("Options");
         foreach (var option in childNode.DisambiguationOptions)
         {
             xw.WriteStartElement("Option");
             xw.WriteAttributeString("Text", option.Text);
             if (option.EntityValue != null)
             {
                 xw.WriteAttributeString("Entity", option.EntityValue.Entity.Name);
                 xw.WriteAttributeString("EntityValue", option.EntityValue.Name);
             }
             xw.WriteEndElement();
         }
         xw.WriteEndElement();
     }
     if (childNode.EntityMatch != null)
     {
         WriteEntityMatch(xw, childNode.EntityMatch);
     }
     WriteChildrenNodes(xw, childNode);
     xw.WriteEndElement();
 }
コード例 #2
0
 public void AddDisambiguationQuestion(DisambiguationQuestion question)
 {
     if (question.EntityMatch != null)
     {
         var entityMatches = new List <EntityMatch>(1);
         entityMatches.Add(question.EntityMatch);
         AddEntityMatches(entityMatches);
     }
 }