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); } } }
public string GetDefaultConfirmMode() { string myString = PathMaker.LookupStartShadow().GetDefaultSetting(Strings.DefaultSettingsConfirmMode); //string tempDefaultConfirmValue = myShadow.GetDefaultSetting(Strings.DefaultSettingsConfirmMode); return(myString); }
public override void OnShapeExitTextEdit() { base.OnShapeExitTextEdit(); string prefix, number, name, errorMessage; string newName = StateIdForDisplay(shape.Text); DisectStateIdIntoParts(newName, out prefix, out number, out name); // always use uppercase prefixes prefix = prefix.ToUpper(); // They can enter anything in the shape text - here we make sure it's a good stateid // and, if not, we make it one. if (!ValidateStateIdTextBoxStrings(prefix, number, name, out errorMessage)) { if (GetStateId().Length > 0) { string oldPrefix, oldNumber, oldName; DisectStateIdIntoParts(GetStateId(), out oldPrefix, out oldNumber, out oldName); newName = oldPrefix.ToUpper() + oldNumber + Strings.StateIdWordDisplayDelimiter + newName; } else { newName = StatePrefixAndNumberManager.GetCurrentStateIdPrefix() + StatePrefixAndNumberManager.GetNextAvailableNumber() + Strings.StateIdWordDisplayDelimiter + newName; } } else { // make sure we pick up the uppercase prefix newName = prefix + number + Strings.StateIdWordDisplayDelimiter + name; } string oldStateId = GetStateId(); string newStateId = StateIdForStorage(newName); SetStateId(newStateId); StartShadow shadowStart = PathMaker.LookupStartShadow(); if (shadowStart != null && !oldStateId.Equals(newStateId)) { string promptIdFormat = shadowStart.GetDefaultSetting(Strings.DefaultSettingsPromptIDFormat); if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial)) { RedoPromptIds(0, promptIdFormat); } } }
internal Table GetPrompts() { Table table = Common.GetCellTable(shape, ShapeProperties.Play.Prompts); string promptText = shape.Shapes[promptShapeIndex].Text; if (table.IsEmpty() && promptText.Length > 0) { table = new Table(1, Enum.GetNames(typeof(TableColumns.Prompts)).Length); table.SetData(0, (int)TableColumns.Prompts.Wording, promptText); StartShadow shadowStart = PathMaker.LookupStartShadow(); if (shadowStart != null) { string promptIdFormat = shadowStart.GetDefaultSetting(Strings.DefaultSettingsPromptIDFormat); if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial)) { RedoPromptIds(0, promptIdFormat, table); } } } return(table); }
public static void LoadCommandTransitionDataGridView(DataGridView gridView, Table table) { BindingList <CommandTransitionRow> ctList = CommandTransitionRow.GetRowsFromTable(table); string myDefaultConfirmValue = PathMaker.LookupStartShadow().GetDefaultConfirmMode(); if (gridView.Columns.Count == 0) { gridView.AutoGenerateColumns = false; AddTextBoxColumn(gridView, CommandTransitionRow.OptionColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.VocabColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.DTMFColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ConditionColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ActionColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.GotoColumnName); AddStringComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName); //LoadComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName, confirmValues); LoadComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName, confirmValues, PathMaker.LookupStartShadow().GetDefaultConfirmMode());//JDK - need to find a way to set display default here - it DOES NOT work with Never as the default value AddTextBoxColumn(gridView, CommandTransitionRow.OptionDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.VocabDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.DTMFDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ConditionDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ActionDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.GotoDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ConfirmDateStampColumnName); gridView.DefaultValuesNeeded -= new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded); gridView.DefaultValuesNeeded += new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded); //gridView.RowsAdded - new DataGridViewCellFormattingEventHandler(OnCellDropBoxCellSettingDefault);//JDK //gridView.RowsAdded -= new DataGridViewRowsAddedEventHandler(OnCellDropBoxCellSettingDefault);//JDK //gridView.DefaultValuesNeeded += new DataGridViewRowEventHandler(OnCellDropBoxCellSettingDefault);//JDK ApplyCommonDataGridViewSettings <CommandTransitionRow>(gridView, false); HideDateStampColumns(gridView); gridView.Columns[CommandTransitionRow.GotoColumnName].ReadOnly = true; } gridView.DataSource = ctList; }
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); }
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); } } } }
public static void LoadStartCommandTransitionDataGridView(DataGridView gridView, Table table) { BindingList <StartCommandTransitionRow> ctList = StartCommandTransitionRow.GetRowsFromTable(table); if (gridView.Columns.Count == 0) { gridView.AutoGenerateColumns = false; AddTextBoxColumn(gridView, CommandTransitionRow.OptionColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.VocabColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.DTMFColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ConditionColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ActionColumnName); AddItemComboBoxColumn(gridView, CommandTransitionRow.GotoColumnName); AddStringComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName); //LoadComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName, confirmValues); LoadComboBoxColumn(gridView, CommandTransitionRow.ConfirmColumnName, confirmValues, PathMaker.LookupStartShadow().GetDefaultConfirmMode());//JDK Added this - it works with Never as the default value AddTextBoxColumn(gridView, CommandTransitionRow.OptionDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.VocabDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.DTMFDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ConditionDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ActionDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.GotoDateStampColumnName); AddTextBoxColumn(gridView, CommandTransitionRow.ConfirmDateStampColumnName); gridView.DefaultValuesNeeded -= new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded); gridView.DefaultValuesNeeded += new DataGridViewRowEventHandler(OnCommandTransitionDefaultValuesNeeded); ApplyCommonDataGridViewSettings <StartCommandTransitionRow>(gridView, true); HideDateStampColumns(gridView); } // loaded each time to make sure there's a full list of state names LoadItemComboBoxColumn(gridView, CommandTransitionRow.GotoColumnName, GetAllPossibleGotos()); gridView.DataSource = ctList; }