예제 #1
0
        public static void RedoAllHiddenPromptMarkers()
        {
            //the start step has globals and default confirmation prompts that must be modified as well
            Shadow          startStep       = PathMaker.LookupStartShadow();
            ChangeLogShadow changeLogShadow = PathMaker.LookupChangeLogShadow();
            DateTime        triggerDate;

            DateTime.TryParse(Strings.StampFormatChangeDate, out triggerDate);

            //Common.WarningMessage("changeLogShadow.GetLastChangeDate() = " + changeLogShadow.GetLastChangeDate());

            if ((startStep != null) && (changeLogShadow.GetLastChangeDate() <= triggerDate))
            {
                string tmpAlertMsg = "* * * ALERT - CHANGE TRACKING FORMATS WILL BE UPDATED! * * *" +
                                     "\r\n\r\nHidden date stamps will now use version numbers instead." +
                                     "\r\n\r\nThis makes it INCOMPATIBLE with older versions of PathMaker." +
                                     "\r\n\r\nAdd a new Revision History line for this file update process with NO HIGHLIGHT COLOR." +
                                     "  Then select SAVE AS and create a new .VUI file once the table update is complete." +
                                     "  You may then add a new Revision Histroy record to begin documenting your design changes with highlights." +
                                     "  Old colors should be fine if left on during this update process.";

                Common.WarningMessage(tmpAlertMsg);

                //scrub the version stamps in the ChangeLogShadow before any other processing takes place - we do not want any aplhas in the version strings for float comparisons later
                Table   table                = changeLogShadow.GetChangeLog();
                String  lastVersionStamp     = "";
                string  tempScrubbedVer      = "";
                Boolean versionStampsUpdated = false;
                for (int r = 0; r < table.GetNumRows(); r++)
                {
                    lastVersionStamp = table.GetData(r, (int)TableColumns.ChangeLog.Version);
                    tempScrubbedVer  = Common.CleanupVersionLabel(lastVersionStamp);
                    if (!tempScrubbedVer.Equals(lastVersionStamp))
                    {
                        table.SetData(r, (int)TableColumns.ChangeLog.Version, tempScrubbedVer);
                        versionStampsUpdated = true;
                    }
                }
                if (versionStampsUpdated)
                {
                    changeLogShadow.SetChangeLog(table);
                }

                startStep.RedoHiddenDateMarkers();

                List <Shadow> shadowList = PathMaker.LookupAllShadows();
                //JDK added this to update old diagrams with hidden date stamps to new version stamp format
                foreach (Shadow s in shadowList)
                {
                    StateShadow stateShadow = s as StateShadow;
                    if (stateShadow != null && (stateShadow.GetShapeType().Equals(ShapeTypes.Play) || stateShadow.GetShapeType().Equals(ShapeTypes.Interaction)))
                    {
                        stateShadow.RedoHiddenDateMarkers(stateShadow);
                        //Common.WarningMessage("Skipping RedoHiddenDateMarkers");
                    }

                    if (stateShadow != null && (stateShadow.GetShapeType().Equals(ShapeTypes.Decision) || stateShadow.GetShapeType().Equals(ShapeTypes.Data)))
                    {
                        StateWithTransitionShadow stateTranShadow = s as StateWithTransitionShadow;
                        //Common.WarningMessage("Starting RedoHiddenDateMarkers for Decision or Data State:" + stateTranShadow.GetStateId());
                        stateTranShadow.RedoHiddenDateMarkers(stateTranShadow);
                    }
                }
            }
        }