Пример #1
0
 private static void WriteRedirectToLongTail(XmlWriter xw, GotoNode childNode)
 {
     xw.WriteStartElement("RedirectToLongTail");
     WriteDialogNodeProperties(xw, childNode);
     if (!String.IsNullOrEmpty(childNode.MessageExpression))
     {
         xw.WriteStartElement("Message");
         xw.WriteString(childNode.MessageExpression);
         xw.WriteEndElement();
     }
     WriteChildrenNodes(xw, childNode);
     xw.WriteEndElement();
 }
Пример #2
0
 private static void WriteGotoNode(XmlWriter xw, GotoNode childNode)
 {
     xw.WriteStartElement("Goto");
     xw.WriteAttributeString("Ref", childNode.TargetNodeId);
     WriteDialogNodeProperties(xw, childNode);
     if (!String.IsNullOrEmpty(childNode.MessageExpression))
     {
         xw.WriteStartElement("Message");
         xw.WriteString(childNode.MessageExpression);
         xw.WriteEndElement();
     }
     WriteChildrenNodes(xw, childNode);
     xw.WriteEndElement();
 }
Пример #3
0
        private static void NavigateToNextNode(Dialog dialog, IDictionary <string, string> variablesValues, GotoNode gotoNode, DialogExecutionResult result)
        {
            // Adjust variables values
            ExecuteVariableAssignments(gotoNode, variablesValues);

            // Store the result of this execution
            var nodeExecution = new DialogNodeExecution(gotoNode);

            result.AddDialogNodeExecution(nodeExecution);

            // Error message if no target node found
            if (gotoNode.TargetNode == null)
            {
                result.LogMessage("Goto node is a dead end : the reference to target node id '" + gotoNode.TargetNodeId + "' could not be resolved");
            }
            else
            {
                // Contine with the target node and its siblings
                SelectChildNode(dialog, variablesValues, gotoNode.TargetNode.ParentNode, gotoNode.TargetNode, result);
            }
        }