Exemplo n.º 1
0
        private void ChangeLogForm_Load(object sender, EventArgs e)
        {
            Table table = shadow.GetChangeLog();

            CommonForm.LoadChangeLogDataGridView(changeLogGridView, table);
            changeLogGridView.Focus();
        }
        private static void AddChangeLog(Document doc, ChangeLogShadow changeLogShadow, String label)
        {
            Microsoft.Office.Interop.Word.Table changeLogTable = null;
            if (label.Contains("VUI"))
            {
                changeLogTable = doc.Tables[Templates.ChangeLog];
            }
            else
            {
                changeLogTable = doc.Tables[Templates.ChangeLogHLD];
            }
            Table table = changeLogShadow.GetChangeLog();
            InsertWordTableRows(changeLogTable, 2, table.GetNumRows() - 1);

            int wordRow = 2;
            for (int row = 0; row < table.GetNumRows(); row++) {
                changeLogTable.Cell(wordRow, 1).Range.InsertAfter(table.GetData(row, (int)TableColumns.ChangeLog.Date));
                changeLogTable.Cell(wordRow, 2).Range.InsertAfter(table.GetData(row, (int)TableColumns.ChangeLog.Version));
                changeLogTable.Cell(wordRow, 3).Range.InsertAfter(table.GetData(row, (int)TableColumns.ChangeLog.Details));
                changeLogTable.Cell(wordRow, 4).Range.InsertAfter(table.GetData(row, (int)TableColumns.ChangeLog.Author));

                string color = table.GetData(row, (int)TableColumns.ChangeLog.Highlight);
                WdColorIndex colorIndex = ConvertStringToColorIndex(color);
                for (int i = 1; i <= 4; i++)
                    changeLogTable.Cell(wordRow, i).Range.Font.Shading.BackgroundPatternColorIndex = colorIndex;
                wordRow++;
            }

            Selection content = doc.Application.Selection;
            content.GoTo(What: WdGoToItem.wdGoToBookmark, Name: "TitleVersion");
            content.TypeText("Version " + changeLogShadow.GetLastChangeVersion());
            content.GoTo(What: WdGoToItem.wdGoToBookmark, Name: "TitleLastModifiedDate");
            DateTime date;
            if (DateTime.TryParse(changeLogShadow.GetLastLogChangeDate(), out date))
                content.TypeText(date.ToString("MMMM dd, yyyy"));
        }
Exemplo n.º 3
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);
                    }
                }
            }
        }