Ejemplo n.º 1
0
        // returns are special - we need to make sure the keyword gets in there
        private static string GetXmlGotoFromData(string data)
        {
            if (data == null || data.Length == 0)
            {
                return("");
            }

            Shadow targetShadow = Common.GetGotoTargetFromData(data);

            if (targetShadow == null)
            {
                return(data);
            }
            else
            {
                ReturnShadow returnShadow = targetShadow as ReturnShadow;
                if (returnShadow != null)
                {
                    return(Strings.ReturnKeyword);
                }
                else
                {
                    return(targetShadow.GetGotoName());
                }
            }
        }
Ejemplo n.º 2
0
        public static BindingList <CommandTransitionRow> GetRowsFromTable(Table table)
        {
            BindingList <CommandTransitionRow> list = new BindingList <CommandTransitionRow>();

            for (int row = 0; row < table.GetNumRows(); row++)
            {
                CommandTransitionRow ct = new CommandTransitionRow();
                ct.Action    = table.GetData(row, (int)TableColumns.CommandTransitions.Action);
                ct.Condition = table.GetData(row, (int)TableColumns.CommandTransitions.Condition);
                ct.Confirm   = table.GetData(row, (int)TableColumns.CommandTransitions.Confirm);
                ct.DTMF      = table.GetData(row, (int)TableColumns.CommandTransitions.DTMF);
                // stash the real goto data in a hidden column
                ct.GotoData_TreatAsDateStamp = table.GetData(row, (int)TableColumns.CommandTransitions.Goto);
                Shadow targetShadow = Common.GetGotoTargetFromData(ct.GotoData_TreatAsDateStamp);
                if (targetShadow == null)
                {
                    ct.Goto = ct.GotoData_TreatAsDateStamp;
                }
                else
                {
                    ct.Goto = targetShadow.GetGotoName();
                }
                ct.Option             = table.GetData(row, (int)TableColumns.CommandTransitions.Option);
                ct.Vocab              = table.GetData(row, (int)TableColumns.CommandTransitions.Vocab);
                ct.ActionDateStamp    = table.GetData(row, (int)TableColumns.CommandTransitions.ActionDateStamp);
                ct.ConditionDateStamp = table.GetData(row, (int)TableColumns.CommandTransitions.ConditionDateStamp);
                ct.ConfirmDateStamp   = table.GetData(row, (int)TableColumns.CommandTransitions.ConfirmDateStamp);
                ct.DTMFDateStamp      = table.GetData(row, (int)TableColumns.CommandTransitions.DTMFDateStamp);
                ct.GotoDateStamp      = table.GetData(row, (int)TableColumns.CommandTransitions.GotoDateStamp);
                ct.OptionDateStamp    = table.GetData(row, (int)TableColumns.CommandTransitions.OptionDateStamp);
                ct.VocabDateStamp     = table.GetData(row, (int)TableColumns.CommandTransitions.VocabDateStamp);
                list.Add(ct);
            }
            return(list);
        }
Ejemplo n.º 3
0
        // returns are special - we need to make sure the keyword gets in there
        private static string GetXmlGotoFromShadow(Shadow targetShadow)
        {
            if (targetShadow == null)
            {
                return(Strings.DisconnectedConnectorTarget);
            }

            ReturnShadow returnShadow = targetShadow as ReturnShadow;

            if (returnShadow != null)
            {
                return(Strings.ReturnKeyword);
            }
            else
            {
                return(targetShadow.GetGotoName());
            }
        }
        public override string GetGotoName()
        {
            string uid = GetSubDialogUID();

            if (uid == null || uid.Length == 0)
            {
                return(Strings.DisconnectedConnectorTarget);
            }
            else
            {
                Shadow shadow = PathMaker.LookupShadowByUID(GetSubDialogUID());
                if (shadow != null)
                {
                    return(shadow.GetGotoName());
                }
                else
                {
                    return(Strings.DisconnectedConnectorTarget);
                }
            }
        }
Ejemplo n.º 5
0
        private static void AddSubDialogElement(XmlDocument xmlDoc, SubDialogShadow shadow)
        {
            XmlElement stateElement = CreateElement(xmlDoc.DocumentElement, xmlStrings.SubDialog);

            stateElement.SetAttribute(xmlStrings.StateId, shadow.GetStateId());

            XmlElement startingStateElement = CreateElement(stateElement, xmlStrings.StartingState);

            Shadow targetShadow = shadow.GetFirstStateTarget();

            if (targetShadow == null)
            {
                startingStateElement.InnerText = Strings.DisconnectedConnectorTarget;
            }
            else
            {
                startingStateElement.InnerText = targetShadow.GetGotoName();
            }

            AddReturnList(shadow, stateElement);
            AddDeveloperNotes(shadow.GetDeveloperNotes(), stateElement);
        }
 private static string CachedGetGotoName(Shadow shadow)
 {
     string name;
     if (gotoNameCache.TryGetValue(shadow, out name))
         return name;
     name = shadow.GetGotoName();
     gotoNameCache.Add(shadow, name);
     return name;
 }
Ejemplo n.º 7
0
        // returns are special - we need to make sure the keyword gets in there
        private static string GetXmlGotoFromShadow(Shadow targetShadow)
        {
            if (targetShadow == null)
                return Strings.DisconnectedConnectorTarget;

            ReturnShadow returnShadow = targetShadow as ReturnShadow;
            if (returnShadow != null)
                return Strings.ReturnKeyword;
            else
                return targetShadow.GetGotoName();
        }