public override void FixUIDReferencesAfterPaste(Dictionary <string, string> oldGUIDToNewGUIDMap)
        {
            string oldUID = GetSubDialogUID();
            string newUID;

            newUID = CommonShadow.GetNewUIDAfterPaste(oldUID, oldGUIDToNewGUIDMap, true);
            if (newUID.Length == 0)
            {
                Common.ErrorMessage("Call SubDialog refers to a SubDialog which can't be found, clearing");
                newUID = "";
            }
            SetSubDialogUID(newUID);
        }
Ejemplo n.º 2
0
        public override int RedoPromptIds(int startNumber, string promptIdFormat)
        {
            Table table = GetPromptTypes();
            int   added = CommonShadow.RedoPromptTypeIds(ref table, null, startNumber, promptIdFormat);

            if (added > 0)
            {
                SetPromptTypes(table);
            }
            table = GetConfirmationPrompts();
            int confirmAdded = CommonShadow.RedoConfirmationPromptIds(ref table, null, startNumber + added, promptIdFormat);

            if (confirmAdded > 0)
            {
                SetConfirmationPrompts(table);
            }
            return(added + confirmAdded);
        }
Ejemplo n.º 3
0
        public override void FixUIDReferencesAfterPaste(Dictionary <string, string> oldGUIDToNewGUIDMap)
        {
            Table table = GetTransitions();

            for (int row = table.GetNumRows() - 1; row >= 0; row--)
            {
                string oldUID = table.GetData(row, (int)TableColumns.Transitions.Goto);
                string newUID = CommonShadow.GetNewUIDAfterPaste(oldUID, oldGUIDToNewGUIDMap, false);
                if (newUID == null)
                {
                    table.DeleteRow(row);
                }
                else if (oldUID != newUID)
                {
                    table.SetData(row, (int)TableColumns.Transitions.Goto, newUID);
                }
            }
            SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
        }
Ejemplo n.º 4
0
        public override void FixUIDReferencesAfterPaste(Dictionary <string, string> oldGUIDToNewGUIDMap)
        {
            Table table = GetCommandTransitions();

            for (int row = table.GetNumRows() - 1; row >= 0; row--)
            {
                string oldUID = table.GetData(row, (int)TableColumns.CommandTransitions.Goto);
                string newUID = CommonShadow.GetNewUIDAfterPaste(oldUID, oldGUIDToNewGUIDMap, false);
                if (newUID == null)
                {
                    Common.ErrorMessage("Transition in Start refers to state which can't be found, changing to hang up");
                    table.SetData(row, (int)TableColumns.CommandTransitions.Goto, Strings.HangUpKeyword);
                }
                else if (oldUID != newUID)
                {
                    table.SetData(row, (int)TableColumns.CommandTransitions.Goto, newUID);
                }
            }
            SetCommandTransitions(table);

            table = GetMaxHandling();
            for (int row = table.GetNumRows() - 1; row >= 0; row--)
            {
                string oldUID = table.GetData(row, (int)TableColumns.MaxHandling.Goto);
                if (oldUID == null || oldUID.Length == 0)
                {
                    continue;
                }
                string newUID = CommonShadow.GetNewUIDAfterPaste(oldUID, oldGUIDToNewGUIDMap, true);
                if (newUID == null)
                {
                    Common.ErrorMessage("MaxHandler for Start refers to state which can't be found, changing to hang up");
                    table.SetData(row, (int)TableColumns.MaxHandling.Goto, Strings.HangUpKeyword);
                }
                else if (oldUID != newUID)
                {
                    table.SetData(row, (int)TableColumns.MaxHandling.Goto, newUID);
                }
            }
            SetMaxHandling(table);
        }
Ejemplo n.º 5
0
        public override void OnConnectorLabelChange(ConnectorShadow shadow)
        {
            Table table = GetTransitions();

            for (int r = 0; r < table.GetNumRows(); r++)
            {
                if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId()))
                {
                    string condition    = table.GetData(r, (int)TableColumns.Transitions.Condition);
                    string newCondition = CommonShadow.GetStringWithNewConnectorLabel(condition, shadow.GetLabelName());

                    if (!condition.Equals(newCondition))
                    {
                        table.SetData(r, (int)TableColumns.Transitions.Condition, newCondition);
                        //table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                        table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added

                        SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
                    }
                    break;
                }
            }
        }
Ejemplo n.º 6
0
        internal void SetPrompts(Table table)
        {
            // once they've edited these - no longer allow edits of the shape text for prompts
            Common.LockShapeText(shape.Shapes[promptShapeIndex]);

            bool foundOne = false;

            for (int row = 0; row < table.GetNumRows(); row++)
            {
                string prompt = table.GetData(row, (int)TableColumns.Prompts.Wording);
                if (prompt.Length > 0)
                {
                    Common.ForcedSetShapeText(shape.Shapes[promptShapeIndex], CommonShadow.PromptToShapeLabel(prompt));
                    foundOne = true;
                    break;
                }
            }
            if (!foundOne)
            {
                Common.ForcedSetShapeText(shape.Shapes[promptShapeIndex], "");
            }

            Common.SetCellTable(shape, ShapeProperties.Play.Prompts, table);
        }
Ejemplo n.º 7
0
        public override void OnConnectAddOutput(Shadow shadow)
        {
            base.OnConnectAddOutput(shadow);
            Table table = GetTransitions();

            // make sure it's not already in there - this can happen with undo/redo
            for (int r = 0; r < table.GetNumRows(); r++)
            {
                if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId()))
                {
                    return;
                }
            }

            if (table.IsEmpty())
            {
                table = new Table(1, Enum.GetNames(typeof(TableColumns.Transitions)).Length);
            }
            else
            {
                table.AddRow();
            }

            ConnectorShadow connector = shadow as ConnectorShadow;

            if (connector != null)
            {
                string label = connector.GetLabelName();
                if (label.Length > 0)
                {
                    table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.Condition, CommonShadow.GetStringWithNewConnectorLabel("", label));
                    //table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.ConditionDateStamp, DateTime.Today.ToString(Strings.DateColumnFormatString));
                    table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.ConditionDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());
                }
            }

            table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.Goto, shadow.GetUniqueId());
            //table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.GotoDateStamp, DateTime.Today.ToString(Strings.DateColumnFormatString));
            table.SetData(table.GetNumRows() - 1, (int)TableColumns.Transitions.GotoDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());
            SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table);
        }