Пример #1
0
        public static void RedoAllPromptIds()
        {
            List <Shadow> shadowList  = PathMaker.LookupAllShadows();
            int           count       = 100;
            StartShadow   startShadow = PathMaker.LookupStartShadow();

            if (startShadow == null)
            {
                Common.ErrorMessage("No start shape available to determine prompt id format");
                return;
            }

            string promptIdFormat = startShadow.GetDefaultSetting(Strings.DefaultSettingsPromptIDFormat);

            startShadow.RedoPromptIds(count, promptIdFormat);

            foreach (Shadow s in shadowList)
            {
                StateShadow stateShadow = s as StateShadow;
                if (stateShadow != null)
                {
                    count += stateShadow.RedoPromptIds(count, promptIdFormat);
                }
            }
        }
Пример #2
0
 internal static void ApplyPromptRecordingList(PromptRecordingList recordingList)
 {
     foreach (Shadow shadow in PathMaker.LookupAllShadows())
     {
         shadow.ApplyPromptsFromRecordingList(recordingList);
     }
 }
Пример #3
0
        private void dialogStateCountToolStripMenuItem_Click(object sender, EventArgs e)
        {
            List <Shadow> shadows = PathMaker.LookupAllShadows();

            int interaction = 0;
            int play        = 0;
            int data        = 0;
            int decision    = 0;
            int subdialog   = 0;
            int callsub     = 0;

            foreach (Shadow shadow in shadows)
            {
                switch (shadow.GetShapeType())
                {
                case ShapeTypes.Interaction:
                    interaction++;
                    break;

                case ShapeTypes.Play:
                    play++;
                    break;

                case ShapeTypes.Data:
                    data++;
                    break;

                case ShapeTypes.Decision:
                    decision++;
                    break;

                case ShapeTypes.SubDialog:
                    subdialog++;
                    break;

                case ShapeTypes.CallSubDialog:
                    callsub++;
                    break;

                default:
                    break;
                }
            }

            string info = "\r\n\r\nInteraction\t: " + interaction + "\r\n";

            info += "Play\t\t: " + play + "\r\n";
            info += "Data\t\t: " + data + "\r\n";
            info += "Decision\t\t: " + decision + "\r\n";
            info += "SubDialog\t: " + subdialog + "\r\n";
            info += "Call SubDialog\t: " + callsub + "\r\n";

            LogoBox aboutBox = new LogoBox(info);

            aboutBox.Text = "Dialog State Count";
            aboutBox.ShowDialog();
        }
Пример #4
0
        internal static PromptRecordingList GetPromptRecordingListVer(String onOrAfterVersion)
        {
            PromptRecordingList recordingList = new PromptRecordingList();

            foreach (Shadow shadow in PathMaker.LookupAllShadows())
            {
                shadow.AddPromptsToRecordingListVer(recordingList, onOrAfterVersion);
            }
            return(recordingList);
        }
Пример #5
0
        internal static PromptRecordingList GetPromptRecordingList(DateTime?onOrAfterDate)
        {
            PromptRecordingList recordingList = new PromptRecordingList();

            foreach (Shadow shadow in PathMaker.LookupAllShadows())
            {
                shadow.AddPromptsToRecordingList(recordingList, onOrAfterDate);
            }
            return(recordingList);
        }
        private void highlightStateForRow(int rowIndex)
        {
            string tmpline   = UISpecResultsGridView[0, rowIndex].Value.ToString();
            string matchName = string.Empty;

            Regex r1    = new Regex(Strings.StartTargetName);
            Match match = r1.Match(tmpline);

            //check to see if it's is a Start shape or something like it without ID Number.
            if (match.Success)
            {
                matchName = match.Groups[0].Value;
            }
            else
            {
                r1    = new Regex("[A-Z]{2}[0-9]{4}");
                match = r1.Match(tmpline);
                if (match.Success)
                {
                    matchName = match.Groups[0].Value;
                }
                else
                {
                    return;
                }
            }

            List <Shadow> shadowList = PathMaker.LookupAllShadows();

            foreach (Shadow shadow in shadowList)
            {
                StateShadow stateShadow = shadow as StateShadow;
                if (stateShadow != null)
                {
                    string stateName = stateShadow.GetStateId();

                    if (stateName.Contains(matchName))
                    {
                        visioControl.Document.Application.ActiveWindow.Page = visioControl.Document.Application.ActivePage;
                        shadow.SelectShape();
                        break;
                    }
                }
                else
                {
                    //if stateShadow is null then if it is a start shape
                    if (shadow.GetShapeType().ToString().Contains(matchName))
                    {
                        visioControl.Document.Application.ActiveWindow.Page = visioControl.Document.Application.ActivePage;
                        shadow.SelectShape();
                        break;
                    }
                }
            }
        }
Пример #7
0
        internal static DesignNotesList GetDesignNotesList()
        {
            DesignNotesList designNotesList = new DesignNotesList();

            foreach (Shadow shadow in PathMaker.LookupAllShadows())
            {
                shadow.AddDesignNotesToList(designNotesList);
                //shadow.AddPromptsToRecordingList(recordingList, onOrAfterDate);
            }
            return(designNotesList);
        }
Пример #8
0
        public override void OnBeforeShapeDelete()
        {
            StatePrefixAndNumberManager.Remove(this);

            // check to see if any max handlers use this - if so change to hang up
            List <Shadow> shadowList = PathMaker.LookupAllShadows();

            foreach (Shadow s in shadowList)
            {
                if (s.RemoveGotosThatDontUseConnectors(shape.get_UniqueID((short)VisUniqueIDArgs.visGetOrMakeGUID)))
                {
                    Common.ErrorMessage("Shape was being used as a goto in " + s.GetGotoName() + " - changing to Hang up");
                }
            }
        }
Пример #9
0
        internal static string ExportFastPathXML(AxMicrosoft.Office.Interop.VisOcx.AxDrawingControl visioControl, bool useTmpFile)
        {
            DocTitleShadow docTitleShadow = PathMaker.LookupDocTitleShadow();

            if (docTitleShadow == null)
            {
                Common.ErrorMessage("Missing Document Title shape");
                return(null);
            }
            StartShadow startShadow = PathMaker.LookupStartShadow();

            if (startShadow == null)
            {
                Common.ErrorMessage("Missing Start shape");
                return(null);
            }

            changeLogShadow = PathMaker.LookupChangeLogShadow();
            if (changeLogShadow == null)
            {
                Common.ErrorMessage("Missing Change Log shape");
                return(null);
            }

            if (saveFileDialog == null)
            {
                saveFileDialog             = new SaveFileDialog();
                saveFileDialog.Title       = Common.GetResourceString(Strings.SaveFastPathXMLTitleRes);
                saveFileDialog.Filter      = Common.GetResourceString(Strings.SaveFastPathXMLFilterRes);
                saveFileDialog.FilterIndex = 1;
            }

            saveFileDialog.InitialDirectory = PathMaker.getCurrentFileDirectory(visioControl);
            saveFileDialog.RestoreDirectory = true;

            targetFilename          = visioControl.Src;
            currentFileName         = System.IO.Path.GetFileName(targetFilename);
            saveFileDialog.FileName = Common.StripExtensionFileName(currentFileName) + ".xml";

            if (!useTmpFile)
            {
                if (saveFileDialog.ShowDialog() == DialogResult.OK)
                {
                    targetFilename = saveFileDialog.FileName;
                }
                else
                {
                    return(null);
                }
            }
            else
            {
                targetFilename = saveFileDialog.FileName + ".tmp";
            }

            XmlDocument xmlDoc = new XmlDocument();

            xmlDoc.XmlResolver = null;
            xmlDoc.LoadXml(xmlStrings.Header);
            xmlDoc.DocumentElement.SetAttribute(xmlStrings.Project, docTitleShadow.GetProjectName());
            xmlDoc.DocumentElement.SetAttribute(xmlStrings.Client, docTitleShadow.GetClientName());
            xmlDoc.DocumentElement.SetAttribute(xmlStrings.LastModified, changeLogShadow.GetLastLogChangeDate());
            xmlDoc.DocumentElement.SetAttribute(xmlStrings.Version, changeLogShadow.GetLastChangeVersion());

            AddStartElement(xmlDoc, startShadow);

            List <Shadow> shadowList = PathMaker.LookupAllShadows();
            // sorting them here helps the Missed statements in PathRunner come out in order
            string stateSortOrder = startShadow.GetDefaultSetting(Strings.DefaultSettingsStateSortOrder);

            if (stateSortOrder.Equals(Strings.StateSortOrderAlphaNumerical))
            {
                shadowList.Sort(Common.StateIdShadowSorterAlphaNumerical);
            }
            else if (stateSortOrder.Equals(Strings.StateSortOrderNumericalOnly))
            {
                shadowList.Sort(Common.StateIdShadowSorterNumericalAlpha);
            }
            else
            {
                Common.StateIdShadowSorterVisioHeuristic(shadowList, visioControl.Document, startShadow);
            }

            foreach (Shadow shadow in shadowList)
            {
                switch (shadow.GetShapeType())
                {
                case ShapeTypes.Interaction:
                    AddInteractionElement(xmlDoc, shadow as InteractionShadow);
                    break;

                case ShapeTypes.Play:
                    AddPlayElement(xmlDoc, shadow as PlayShadow);
                    break;

                case ShapeTypes.Decision:
                    AddDecisionElement(xmlDoc, shadow as DecisionShadow);
                    break;

                case ShapeTypes.Data:
                    AddDataElement(xmlDoc, shadow as DataShadow);
                    break;

                case ShapeTypes.SubDialog:
                    AddSubDialogElement(xmlDoc, shadow as SubDialogShadow);
                    break;

                default:
                    break;
                }
            }

            xmlDoc.Save(targetFilename);
            return(targetFilename);
        }
Пример #10
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);
                    }
                }
            }
        }