Beispiel #1
0
        private static int StateIdShadowSorterVisioPageGroupHelper(Shadow a, Shadow b)
        {
            if (a == b)
            {
                return(0);
            }

            StateShadow stateA = a as StateShadow;
            StateShadow stateB = b as StateShadow;

            if (stateA == null)
            {
                return(1);
            }
            if (stateB == null)
            {
                return(-1);
            }

            string stateAPrefix, stateANumber, stateAName;
            string stateBPrefix, stateBNumber, stateBName;

            StateShadow.DisectStateIdIntoParts(stateA.GetStateId(), out stateAPrefix, out stateANumber, out stateAName);
            StateShadow.DisectStateIdIntoParts(stateB.GetStateId(), out stateBPrefix, out stateBNumber, out stateBName);

            int earliestPageA = stateToPageReference[stateAPrefix + stateANumber];
            int earliestPageB = stateToPageReference[stateBPrefix + stateBNumber];

            if (earliestPageA != earliestPageB)
            {
                return(earliestPageA - earliestPageB);
            }

            return(stateA.GetStateId().CompareTo(stateB.GetStateId()));
        }
        public static void Add(StateShadow stateShadow, Shape shape)
        {
            // Not using GetShapeId here because we don't want a fake one - we need to know
            // if we have one in the shape data or not
            string stateId = Common.GetCellString(shape, ShapeProperties.Play.StateId);

            // if we have a stateid already - we need to update our prefix and number tracking
            if (stateId.Length > 0)
            {
                string prefix, number, name;
                StateShadow.DisectStateIdIntoParts(stateId, out prefix, out number, out name);

                prefixNumberToShadow.Add(prefix + number, stateShadow);
                shadowToPrefixNumber.Add(stateShadow, prefix + number);

                if (prefix.Length == PrefixLength)
                {
                    currentStateIdPrefix = prefix.ToUpper();
                }
                if (number.Length == NumberLength)
                {
                    int numInt;

                    if (int.TryParse(number, out numInt))
                    {
                        while (numInt > currentStateNumber)
                        {
                            currentStateNumber = currentStateNumber + nextStateBump;
                            // if we are over 9999 we need to restart at 1000 but use increments of 25
                            if (currentStateNumber > 9999)
                            {
                                currentStateNumber = 1000;
                                if (nextStateBump == 50)
                                {
                                    nextStateBump = 25;
                                }
                                else if (nextStateBump == 25)
                                {
                                    nextStateBump = 10;
                                }
                                else if (nextStateBump == 10)
                                {
                                    nextStateBump = 5;
                                }
                                else
                                {
                                    nextStateBump = 1;
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #3
0
        public static void StateIdShadowSorterVisioHeuristic(List <Shadow> shadowList, Document doc, StartShadow startShadow)
        {
            // group by alpha prefix, then by number within that
            // then sort groups by first visio page reference
            // if both on same page, startPrefix is first, the sort alphanumerically

            string firstPrefix = String.Empty;
            Shadow firstShadow = startShadow.GetFirstStateGotoTarget();

            if (firstShadow != null)
            {
                StateShadow firstState = firstShadow as StateShadow;
                string      firstNumber, firstName;
                StateShadow.DisectStateIdIntoParts(firstState.GetStateId(), out firstPrefix, out firstNumber, out firstName);
            }

            // make a list of first page references of each alpha prefix
            earliestPageReference = new Dictionary <string, int>();
            foreach (Shadow s in shadowList)
            {
                StateShadow sState = s as StateShadow;
                if (sState == null)
                {
                    continue;
                }
                int    pageNumber = s.GetPageNumber();
                string statePrefix, stateNumber, stateName;
                StateShadow.DisectStateIdIntoParts(sState.GetStateId(), out statePrefix, out stateNumber, out stateName);

                // always make this highest priority
                if (statePrefix.Equals(firstPrefix))
                {
                    pageNumber = -1;
                }

                int earliest;
                if (earliestPageReference.TryGetValue(statePrefix, out earliest))
                {
                    if (pageNumber < earliest)
                    {
                        earliestPageReference[statePrefix] = pageNumber;
                    }
                }
                else
                {
                    earliestPageReference.Add(statePrefix, pageNumber);
                }
            }

            shadowList.Sort(StateIdShadowSorterVisioHeuristicHelper);
        }
        public static void Remove(StateShadow stateShadow)
        {
            string prefix, number, name;

            StateShadow.DisectStateIdIntoParts(stateShadow.GetStateId(), out prefix, out number, out name);
            int backupToNumber = currentStateNumber;

            // let's make sure this isn't an undo of a paste of a duplicate
            string      prefixPlusNumber;
            StateShadow shadow;

            if (prefixNumberToShadow.TryGetValue(prefix + number, out shadow))
            {
                if (shadow == stateShadow)
                {
                    // good match - remove
                    prefixNumberToShadow.Remove(prefix + number);
                    shadowToPrefixNumber.Remove(shadow);

                    int numberInt;
                    if (int.TryParse(number, out numberInt))
                    {
                        backupToNumber = numberInt;
                    }
                }
                else
                {
                    if (shadowToPrefixNumber.TryGetValue(stateShadow, out prefixPlusNumber))
                    {
                        // so we are registered with a different prefix + number, remove that one
                        prefixNumberToShadow.Remove(prefixPlusNumber);
                        shadowToPrefixNumber.Remove(stateShadow);

                        int numberInt;
                        if (int.TryParse(number, out numberInt))
                        {
                            backupToNumber = numberInt;
                        }
                    }
                    else
                    {
                        // should never get here...
                        Common.ErrorMessage("Removing a state which isn't in the State Id Map");
                    }
                }
                if (backupToNumber < currentStateNumber)
                {
                    currentStateNumber = backupToNumber;
                }
            }
        }
        // Given a stateId, tells if it's okay to use or not - used when pasting
        // to make sure we don't end up with duplicate ids in use
        internal static bool IsStateIdOkayForUse(string stateId)
        {
            string prefix, number, name;

            StateShadow.DisectStateIdIntoParts(stateId, out prefix, out number, out name);
            if (prefixNumberToShadow.ContainsKey(prefix + number))
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Beispiel #6
0
        public static void StateIdShadowSorterVisioPageGrouping(List <Shadow> shadowList, Document doc, StartShadow startShadow)
        {
            // Try to create a group of states per Visio page then
            // sort alphanumerically so the printing order matches the pages

            //string firstPrefix = String.Empty;
            //Shadow firstShadow = startShadow.GetFirstStateGotoTarget();
            //if (firstShadow != null)
            //{
            //StateShadow firstState = firstShadow as StateShadow;
            //string firstNumber, firstName;
            //StateShadow.DisectStateIdIntoParts(firstState.GetStateId(), out firstPrefix, out firstNumber, out firstName);
            //}

            // make a list of first page references of each alpha prefix
            stateToPageReference = new Dictionary <string, int>();
            foreach (Shadow s in shadowList)
            {
                StateShadow sState = s as StateShadow;
                if (sState == null)
                {
                    continue;
                }
                //int firstPageNumber;
                int    pageNumber = s.GetPageNumber();
                string statePrefix, stateNumber, stateName;
                StateShadow.DisectStateIdIntoParts(sState.GetStateId(), out statePrefix, out stateNumber, out stateName);

                // always make this highest priority
                //if (sState.GetStateId().Equals(firstState.GetStateId()))
                //firstPageNumber = pageNumber;

                int earliest;
                if (stateToPageReference.TryGetValue(statePrefix + stateNumber, out earliest))
                {
                    if (pageNumber < earliest)
                    {
                        stateToPageReference[statePrefix + stateNumber] = pageNumber;
                    }
                }
                else
                {
                    stateToPageReference.Add(statePrefix + stateNumber, pageNumber);
                }
            }

            shadowList.Sort(StateIdShadowSorterVisioPageGroupHelper);
        }
Beispiel #7
0
        internal static void LoadStateIdTextBoxes(TextBox statePrefixTextBox, TextBox stateNumberTextBox, TextBox stateNameTextBox, string stateId)
        {
            if (stateId.Length != 0)
            {
                string tmp = StateShadow.StateIdForDisplay(stateId);

                string prefix, number, name;
                StateShadow.DisectStateIdIntoParts(tmp, out prefix, out number, out name);
                statePrefixTextBox.Text = prefix;
                stateNumberTextBox.Text = number;
                stateNameTextBox.Text   = name;
            }
            else
            {
                statePrefixTextBox.Text = string.Empty;
                stateNumberTextBox.Text = string.Empty;
                stateNameTextBox.Text   = string.Empty;
            }

            statePrefixTextBox.KeyPress -= new KeyPressEventHandler(StatePrefixKeyHandler);
            stateNumberTextBox.KeyPress -= new KeyPressEventHandler(StateNumberKeyHandler);
            statePrefixTextBox.KeyPress += new KeyPressEventHandler(StatePrefixKeyHandler);
            stateNumberTextBox.KeyPress += new KeyPressEventHandler(StateNumberKeyHandler);

            statePrefixTextBox.Validating -= new CancelEventHandler(OnStateIdTextBoxesValidating);
            statePrefixTextBox.Validating += new CancelEventHandler(OnStateIdTextBoxesValidating);
            stateNumberTextBox.Validating -= new CancelEventHandler(OnStateIdTextBoxesValidating);
            stateNumberTextBox.Validating += new CancelEventHandler(OnStateIdTextBoxesValidating);
            stateNameTextBox.Validating   -= new CancelEventHandler(OnStateIdTextBoxesValidating);
            stateNameTextBox.Validating   += new CancelEventHandler(OnStateIdTextBoxesValidating);

            statePrefixTextBox.Validated -= new EventHandler(OnStateIdTextBoxValidated);
            statePrefixTextBox.Validated += new EventHandler(OnStateIdTextBoxValidated);
            stateNumberTextBox.Validated -= new EventHandler(OnStateIdTextBoxValidated);
            stateNumberTextBox.Validated += new EventHandler(OnStateIdTextBoxValidated);
            stateNameTextBox.Validated   -= new EventHandler(OnStateIdTextBoxValidated);
            stateNameTextBox.Validated   += new EventHandler(OnStateIdTextBoxValidated);

            //Handle Text change on TextBox
            statePrefixTextBox.TextChanged -= new EventHandler(OnStateIdTextBoxChanged);
            statePrefixTextBox.TextChanged += new EventHandler(OnStateIdTextBoxChanged);
            stateNumberTextBox.TextChanged -= new EventHandler(OnStateIdTextBoxChanged);
            stateNumberTextBox.TextChanged += new EventHandler(OnStateIdTextBoxChanged);
            stateNameTextBox.TextChanged   -= new EventHandler(OnStateIdTextBoxChanged);
            stateNameTextBox.TextChanged   += new EventHandler(OnStateIdTextBoxChanged);
        }
Beispiel #8
0
        public static int StateIdShadowSorterNumericalAlpha(Shadow a, Shadow b)
        {
            if (a == b)
            {
                return(0);
            }

            StateShadow stateA = a as StateShadow;
            StateShadow stateB = b as StateShadow;

            if (stateA == null)
            {
                return(1);
            }
            if (stateB == null)
            {
                return(-1);
            }

            string stateAPrefix, stateANumber, stateAName;
            string stateBPrefix, stateBNumber, stateBName;

            StateShadow.DisectStateIdIntoParts(stateA.GetStateId(), out stateAPrefix, out stateANumber, out stateAName);
            StateShadow.DisectStateIdIntoParts(stateB.GetStateId(), out stateBPrefix, out stateBNumber, out stateBName);

            int result = stateANumber.CompareTo(stateBNumber);

            if (result == 0)
            {
                return(stateAPrefix.CompareTo(stateBPrefix));
            }
            else
            {
                return(result);
            }
        }
Beispiel #9
0
        void OnShapeAdd(Shape shape)
        {
            ShapeTypes type = Common.GetShapeType(shape);
            bool       is1D = shape.OneD != 0;

            // Tricky - when pasting, Visio gives out new uids to the shapes if there are duplicates
            // in this document.  So, we are going to stash the original ones - unless we are pasting.
            // If we are pasting, the paste end will fix the ones that were added.
            if (!visioControl.Document.Application.get_IsInScope((int)VisUICmds.visCmdUFEditPaste) &&
                !visioControl.Document.Application.get_IsInScope((int)VisUICmds.visCmdUFEditDuplicate))
            {
                string uid    = shape.get_UniqueID((short)VisUniqueIDArgs.visGetOrMakeGUID);
                string cached = Common.GetCellString(shape, Strings.CutCopyPasteTempCellName);

                // when undoing a delete page, you can't write this yet so this check will ignore it
                if (!uid.Equals(cached))
                {
                    Common.SetCellString(shape, Strings.CutCopyPasteTempCellName, uid);
                }
            }
            else if (Common.GetShapeType(shape) == ShapeTypes.OffPageRef)
            {
                Common.ErrorMessage("Pasted off-page reference needs to be connected.  Double click on it to repair.");
                // Because these can be cut and pasted from a single document, clearing these fields
                // allows us to avoid having more than one off page connector pointing to a single other one
                // which causes issues with tracking things in the shadows.  This way here, double clicking
                // on the connector will ask which page to connect it to.
                Common.SetCellString(shape, ShapeProperties.OffPageConnectorDestinationPageID, "");
                Common.SetCellString(shape, ShapeProperties.OffPageConnectorDestinationShapeID, "");
            }

            if (type == ShapeTypes.None && is1D)
            {
                // rogue connector - need to make it conform
                Common.SetCellString(shape, ShapeProperties.ShapeType, ((int)ShapeTypes.Connector).ToString());
                shape.get_CellsSRC((short)VisSectionIndices.visSectionObject,
                                   (short)VisRowIndices.visRowLine,
                                   (short)VisCellIndices.visLineEndArrow).FormulaU = "13";
                shape.get_CellsSRC((short)VisSectionIndices.visSectionObject,
                                   (short)VisRowIndices.visRowLine,
                                   (short)VisCellIndices.visLineRounding).FormulaU = "0.25 in";
                shape.get_CellsSRC((short)VisSectionIndices.visSectionObject,
                                   (short)VisRowIndices.visRowLock,
                                   (short)VisCellIndices.visLockTextEdit).FormulaU = "1";

                // just in case
                Common.FixConnectorTextControl(shape);

                // make every row in the shape data section invisible
                short row = (short)VisRowIndices.visRowFirst;
                while (shape.get_CellsSRCExists((short)VisSectionIndices.visSectionProp, row, (short)VisCellIndices.visCustPropsInvis, (short)VisExistsFlags.visExistsAnywhere) != 0)
                {
                    shape.get_CellsSRC((short)VisSectionIndices.visSectionProp, row++, (short)VisCellIndices.visCustPropsInvis).FormulaU = "TRUE";
                }
            }

            // when a shape is copied and pasted, it will be an exact copy of the previous shape
            // we need fix the duplicate name issue before we do anything else
            string oldPastedStateName = String.Empty;

            if (visioControl.Document.Application.get_IsInScope((int)VisUICmds.visCmdUFEditPaste) ||
                visioControl.Document.Application.get_IsInScope((int)VisUICmds.visCmdUFEditDuplicate))
            {
                string stateId = Common.GetCellString(shape, ShapeProperties.StateId);
                if (stateId.Length > 0)
                {
                    if (!StatePrefixAndNumberManager.IsStateIdOkayForUse(stateId))
                    {
                        oldPastedStateName = stateId;
                        // NEVER, NEVER do this without going through the shadow except here, before the shadow is made
                        Common.SetCellString(shape, ShapeProperties.StateId, String.Empty);
                    }
                }
            }

            Shadow shadow = Common.MakeShapeShadow(shape);

            if (shadow != null)
            {
                // if we have a pasted name that conflicted, this will reuse the name portion
                // but get us a new prefix and number and then renumber any prompts
                if (oldPastedStateName.Length > 0)
                {
                    string prefix, number, name;
                    StateShadow.DisectStateIdIntoParts(oldPastedStateName, out prefix, out number, out name);
                    shape.Text = StateShadow.StateIdForDisplay(name).Trim();
                    // this just pretends we just typed the name portion into the shape itself
                    shadow.OnShapeExitTextEdit();

                    // and now let's renumber any prompts if we're not using the "number" option
                    List <Shadow> shadowList = LookupShadowsByShapeType(ShapeTypes.Start);
                    if (shadowList.Count > 0)
                    {
                        StartShadow startShadow    = shadowList[0] as StartShadow;
                        string      promptIdFormat = startShadow.GetDefaultSetting(Strings.DefaultSettingsPromptIDFormat);
                        if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial))
                        {
                            StateShadow stateShadow = shadow as StateShadow;
                            if (stateShadow != null)
                            {
                                stateShadow.RedoPromptIds(0, promptIdFormat);
                            }
                        }
                    }
                }
                shadowShapeMap.Add(shape.get_UniqueID((short)VisUniqueIDArgs.visGetOrMakeGUID), shadow);
                shadow.OnShapeAdd();

                if (shadow.GetShapeType() == ShapeTypes.DocTitle ||
                    shadow.GetShapeType() == ShapeTypes.ChangeLog ||
                    shadow.GetShapeType() == ShapeTypes.AppDesc ||
                    shadow.GetShapeType() == ShapeTypes.PrefixList ||
                    shadow.GetShapeType() == ShapeTypes.Start)
                {
                    if (LookupShadowsByShapeType(shadow.GetShapeType()).Count > 1)
                    {
                        Common.ErrorMessage("Cannot have two Start, Change Log, or Document Title, App Description or Prefix List shapes");
                        Common.ForcedSetShapeText(shape, Strings.ToBeDeletedLabel);
                    }
                }
            }
            else
            {
                Common.ErrorMessage("Invalid non-PathMaker shape added");
                try {
                    Common.ForcedSetShapeText(shape, Strings.ToBeDeletedLabel);
                }
                catch {
                    // it may be a shape with two subshapes (play/interaction) so try this too
                    try {
                        Common.ForcedSetShapeText(shape.Shapes[0], Strings.ToBeDeletedLabel);
                    }
                    catch {
                        // copying from non-PathMaker visios can cause this to fail depending on shape sheets, locks, etc.
                        // We did our best - we can ignore these
                    }
                }
            }
        }
Beispiel #10
0
        public static int RedoPromptTypeIds(ref Table table, string stateId, int startNumber, string promptIdFormat)
        {
            if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial))
            {
                string statePrefix = "";
                string stateNumber = "";
                string stateName   = "";

                if (stateId != null)
                {
                    StateShadow.DisectStateIdIntoParts(stateId, out statePrefix, out stateNumber, out stateName);
                }

                int   added        = 0;
                int[] nextNumArray = new int[26];
                for (int i = 0; i < 26; i++)
                {
                    nextNumArray[i] = 1;
                }
                char letter = Strings.DefaultPromptType.ToLower().Substring(0, 1)[0];

                for (int row = 0; row < table.GetNumRows(); row++)
                {
                    string type = table.GetData(row, (int)TableColumns.PromptTypes.Type);

                    if (type != null && type.Trim().Length > 0)
                    {
                        letter = type.Trim().ToLower().Substring(0, 1)[0];
                    }

                    if (letter - 'a' < 0 || letter - 'a' > 25)
                    {
                        letter = Strings.DefaultPromptType.ToLower().Substring(0, 1)[0];
                    }

                    if (letter == Strings.DefaultConfirmationPromptLetter)
                    {
                        letter = Strings.DefaultExitBridgePromptLetter;//JDK 08-27-14 added this to prevent stepping on confirm prompting with special exit prompting
                    }
                    string wording = table.GetData(row, (int)TableColumns.PromptTypes.Wording);
                    if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString))
                    {
                        continue;
                    }

                    string newPromptId;
                    if (stateId != null)
                    {
                        if (promptIdFormat.Equals(Strings.PromptIdFormatFull))
                        {
                            newPromptId = stateId + Strings.PromptIdSeparationChar + letter + Strings.PromptIdSeparationChar + nextNumArray[letter - 'a'].ToString();
                        }
                        else
                        {
                            newPromptId = statePrefix + stateNumber + Strings.PromptIdSeparationChar + letter + Strings.PromptIdSeparationChar + nextNumArray[letter - 'a'].ToString();
                        }
                    }
                    else
                    {
                        newPromptId = Strings.GlobalPromptPrefix + Strings.PromptIdSeparationChar + letter + Strings.PromptIdSeparationChar + nextNumArray[letter - 'a'].ToString();
                    }

                    if (!table.GetData(row, (int)TableColumns.PromptTypes.Id).Equals(newPromptId))
                    {
                        table.SetData(row, (int)TableColumns.PromptTypes.Id, newPromptId);
                        //table.SetData(row, (int)TableColumns.PromptTypes.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                        table.SetData(row, (int)TableColumns.PromptTypes.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added
                    }
                    nextNumArray[letter - 'a']++;
                    added++;
                }

                return(added);
            }
            else if (promptIdFormat.Equals(Strings.PromptIdFormatNumeric))
            {
                int nextNum = startNumber;

                for (int row = 0; row < table.GetNumRows(); row++)
                {
                    string wording = table.GetData(row, (int)TableColumns.PromptTypes.Wording);
                    if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString))
                    {
                        continue;
                    }

                    table.SetData(row, (int)TableColumns.PromptTypes.Id, nextNum.ToString());
                    //table.SetData(row, (int)TableColumns.PromptTypes.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                    table.SetData(row, (int)TableColumns.PromptTypes.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added

                    nextNum++;
                }

                return(nextNum - startNumber);
            }
            else
            {
                return(0);
            }
        }
Beispiel #11
0
        public static int RedoConfirmationPromptIds(ref Table table, string stateId, int startNumber, string promptIdFormat)
        {
            if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial))
            {
                string statePrefix = "";
                string stateNumber = "";
                string stateName   = "";

                if (stateId != null)
                {
                    StateShadow.DisectStateIdIntoParts(stateId, out statePrefix, out stateNumber, out stateName);
                }

                int nextNum = 1;

                for (int row = 0; row < table.GetNumRows(); row++)
                {
                    string wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording);
                    if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString))
                    {
                        continue;
                    }

                    string newPromptId;
                    if (stateId != null)
                    {
                        if (promptIdFormat.Equals(Strings.PromptIdFormatFull))
                        {
                            newPromptId = stateId + Strings.PromptIdSeparationChar + Strings.DefaultConfirmationPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString();
                        }
                        else
                        {
                            newPromptId = statePrefix + stateNumber + Strings.PromptIdSeparationChar + Strings.DefaultConfirmationPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString();
                        }
                    }
                    else
                    {
                        newPromptId = Strings.GlobalPromptPrefix.ToString() + Strings.PromptIdSeparationChar +
                                      Strings.DefaultConfirmationPromptLetter.ToString() + Strings.PromptIdSeparationChar + nextNum;
                    }

                    if (!table.GetData(row, (int)TableColumns.ConfirmationPrompts.Id).Equals(newPromptId))
                    {
                        table.SetData(row, (int)TableColumns.ConfirmationPrompts.Id, newPromptId);
                        //table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                        table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added
                    }
                    nextNum++;
                }

                return(nextNum - 1);
            }
            else if (promptIdFormat.Equals(Strings.PromptIdFormatNumeric))
            {
                int nextNum = startNumber;

                for (int row = 0; row < table.GetNumRows(); row++)
                {
                    string wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording);
                    if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString))
                    {
                        continue;
                    }

                    table.SetData(row, (int)TableColumns.ConfirmationPrompts.Id, nextNum.ToString());
                    //table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString));
                    table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added

                    nextNum++;
                }

                return(nextNum - startNumber);
            }
            else
            {
                return(0);
            }
        }