internal override void ApplyPromptsFromRecordingList(PromptRecordingList recordingList) { Table table = GetPrompts(); bool didOne = false; for (int r = 0; r < table.GetNumRows(); r++) { string wording = table.GetData(r, (int)TableColumns.Prompts.Wording); string id = table.GetData(r, (int)TableColumns.Prompts.Id); string newWording = recordingList.getWording(id); if (newWording != null && newWording != wording) { table.SetData(r, (int)TableColumns.Prompts.Wording, newWording); //table.SetData(r, (int)TableColumns.Prompts.WordingDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(r, (int)TableColumns.Prompts.WordingDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); //JDK added table.SetData(r, (int)TableColumns.Prompts.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); //JDK added didOne = true; } } if (didOne) { SetPrompts(table); } }
internal static bool DoVersion6Upgrade(Object arg, ProgressBarForm progressBarForm) { // Added State Sort Order to DefaultSettings Document document = arg as Document; int total = 0; foreach (Page page in document.Pages) { total += page.Shapes.Count; } int count = 0; foreach (Page page in document.Pages) { foreach (Shape shape in page.Shapes) { if (Common.GetShapeType(shape) == ShapeTypes.Start) { Table table = Common.GetCellTable(shape, ShapeProperties.Start.DefaultSettings); if (!table.IsEmpty()) { int row = table.AddRow(); table.SetData(row, (int)TableColumns.NameValuePairs.Name, Strings.DefaultSettingsStateSortOrder); table.SetData(row, (int)TableColumns.NameValuePairs.Value, Strings.StateSortOrderAlphaNumerical); Common.SetCellTable(shape, ShapeProperties.Start.DefaultSettings, table); } } count++; } progressBarForm.SetProgressPercentage(count, total); } return(true); }
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; }
public static Table GetTableFromRows(BindingList<NameValuePairRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length); int row = 0; foreach (NameValuePairRow nv in rows) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name); table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value); table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp); table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp); row++; } return table; }
// returns true if something was changed internal override bool RemoveGotosThatDontUseConnectors(string uidBeingRemoved) { Table table = GetMaxHandling(); bool changed = false; if (!table.IsEmpty()) { for (int r = 0; r < table.GetNumRows(); r++) { if (table.GetData(r, (int)TableColumns.MaxHandling.Goto).Equals(uidBeingRemoved)) { table.SetData(r, (int)TableColumns.MaxHandling.Goto, Strings.HangUpKeyword); //table.SetData(r, (int)TableColumns.MaxHandling.GotoDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(r, (int)TableColumns.MaxHandling.GotoDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added changed = true; } } if (changed) { SetMaxHandling(table); } } table = GetCommandTransitions(); if (!table.IsEmpty()) { for (int r = 0; r < table.GetNumRows(); r++) { if (table.GetData(r, (int)TableColumns.CommandTransitions.Goto).Equals(uidBeingRemoved)) { table.SetData(r, (int)TableColumns.CommandTransitions.Goto, Strings.HangUpKeyword); //table.SetData(r, (int)TableColumns.CommandTransitions.GotoDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(r, (int)TableColumns.CommandTransitions.GotoDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added changed = true; } } if (changed) { SetCommandTransitions(table); } } return(changed); }
internal static Table UnloadSpecialSettingsTextBox(TextBox textBox) { Table table = new Table(1, 2); table.SetData(0, (int)TableColumns.SpecialSettings.Text, textBox.Text); return(table); }
internal static Table UnloadDesignNotesTextBox(TextBox textBox) { Table table = new Table(1, 2); table.SetData(0, (int)TableColumns.DesignNotes.Text, textBox.Text); return(table); }
public static Table GetTableFromRows(BindingList<ChangeLogRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.ChangeLog)).Length); int row = 0; foreach (ChangeLogRow cl in rows) { table.SetData(row, (int)TableColumns.ChangeLog.Date, cl.Date); table.SetData(row, (int)TableColumns.ChangeLog.Version, cl.Version); table.SetData(row, (int)TableColumns.ChangeLog.Details, cl.Details); table.SetData(row, (int)TableColumns.ChangeLog.Author, cl.Author); table.SetData(row, (int)TableColumns.ChangeLog.Highlight, cl.Highlight); row++; } return table; }
internal Table GetMaxHandling() { Table table = Common.GetCellTable(shape, ShapeProperties.Start.MaxHandling); if (table.IsEmpty()) { table = new Table(CommonShadow.MaxHandlingConditions.Length, Enum.GetNames(typeof(TableColumns.MaxHandling)).Length); for (int row = 0; row < CommonShadow.MaxHandlingConditions.Length; row++) { table.SetData(row, (int)TableColumns.MaxHandling.Condition, CommonShadow.MaxHandlingConditions[row]); table.SetData(row, (int)TableColumns.MaxHandling.Count, CommonShadow.MaxHandlingDefaultCounts[row]); table.SetData(row, (int)TableColumns.MaxHandling.Goto, CommonShadow.MaxHandlingDefaultGotos[row]); } } return(table); }
private void UISpecResults_Load(string results) { Table table; int cnt = 0; int lastLine = 0; string[] splitLine = Regex.Split(results, "\r\n\n"); if (splitLine[splitLine.Length - 1].Equals("\r\n\r\n")) { lastLine = splitLine.Length - 1; } else { lastLine = splitLine.Length; } table = new Table(lastLine, 1); foreach (string line in splitLine) { if (cnt < lastLine) { table.SetData(cnt, 0, line); cnt++; } } BindingList <ResultsRow> eList = ResultsRow.GetRowsFromTable(table); UISpecResultsGridView.DataSource = eList; }
//JDK this was added to help with highlight colors with multiple versions on the same day internal static String MaxVersionWithDateColumn(string version, Table table, int column) { String maxVersion = version; String tempVersionStampFix = ""; //double decimalValue = 0; for (int r = 0; r < table.GetNumRows(); r++) { String lastVersionStamp = table.GetData(r, column); //NEW CODE STARTS HERE //if (lastVersionStamp.Trim().IndexOf("/")>=0 || lastVersionStamp.Trim().Equals("")) String tempCleanedVerLabel = CleanupVersionLabel(lastVersionStamp); if (!tempCleanedVerLabel.Equals(lastVersionStamp)) { DateTime tempDTStamp; if (DateTime.TryParse(lastVersionStamp, out tempDTStamp)) { tempVersionStampFix = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(tempDTStamp); lastVersionStamp = tempVersionStampFix; //lastVersionStamp = PathMaker.LookupChangeLogShadow().GetValidVersionString(PathMaker.LookupChangeLogShadow().GetChangeLog(), tempVersionStampFix); table.SetData(r, column, lastVersionStamp);//JDK temporarily removed for testing } } if (Common.ForcedStringVersionToDouble(lastVersionStamp) > Common.ForcedStringVersionToDouble(maxVersion)) { maxVersion = lastVersionStamp; } //NEW CODE ENDS HERE } return(maxVersion); }
internal static void SetTableDataAndDateIfNecessary(Table table, int row, string newValue, TableColumns.NameValuePairs valueColumn, TableColumns.NameValuePairs dateColumn) { string oldValue = table.GetData(row, (int)valueColumn); if (oldValue.Equals(newValue)) { return; } table.SetData(row, (int)valueColumn, newValue); //table.SetData(row, (int)dateColumn, DateTime.Today.ToString(Strings.DateColumnFormatString)); if (table.GetData(0, 0) != "Mode") { table.SetData(row, (int)dateColumn, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added this to fix highlighting by version } }
public static Table GetTableFromRows(BindingList <ChangeLogRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.ChangeLog)).Length); int row = 0; foreach (ChangeLogRow cl in rows) { table.SetData(row, (int)TableColumns.ChangeLog.Date, cl.Date); table.SetData(row, (int)TableColumns.ChangeLog.Version, cl.Version); table.SetData(row, (int)TableColumns.ChangeLog.Details, cl.Details); table.SetData(row, (int)TableColumns.ChangeLog.Author, cl.Author); table.SetData(row, (int)TableColumns.ChangeLog.Highlight, cl.Highlight); row++; } return(table); }
public static Table GetTableFromRows(BindingList <NameValuePairRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length); Boolean newStartStep = false; //Version 1.6.1.13+ uses a new set of fields for init data NV pairs - Notes column was added JDK 08-25-2014 if (table.GetNumColumns() >= 5) { newStartStep = true; } if (newStartStep) { int row = 0; foreach (NameValuePairRow nv in rows) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name); table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value); table.SetData(row, (int)TableColumns.NameValuePairs.Notes, nv.Notes); table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp); table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp); table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, nv.NotesDateStamp); row++; } } else { int row = 0; foreach (NameValuePairRow nv in rows) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name); table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value); //table.SetData(row, (int)TableColumns.NameValuePairs.Notes, nv.Notes); table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp); table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp); //table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, nv.NotesDateStamp); row++; } } return(table); }
public override void FixUIDReferencesAfterPaste(Dictionary <string, string> oldGUIDToNewGUIDMap) { Table table = GetCommandTransitions(); for (int row = table.GetNumRows() - 1; row >= 0; row--) { string oldUID = table.GetData(row, (int)TableColumns.CommandTransitions.Goto); string newUID = CommonShadow.GetNewUIDAfterPaste(oldUID, oldGUIDToNewGUIDMap, false); if (newUID == null) { Common.ErrorMessage("Transition in Start refers to state which can't be found, changing to hang up"); table.SetData(row, (int)TableColumns.CommandTransitions.Goto, Strings.HangUpKeyword); } else if (oldUID != newUID) { table.SetData(row, (int)TableColumns.CommandTransitions.Goto, newUID); } } SetCommandTransitions(table); table = GetMaxHandling(); for (int row = table.GetNumRows() - 1; row >= 0; row--) { string oldUID = table.GetData(row, (int)TableColumns.MaxHandling.Goto); if (oldUID == null || oldUID.Length == 0) { continue; } string newUID = CommonShadow.GetNewUIDAfterPaste(oldUID, oldGUIDToNewGUIDMap, true); if (newUID == null) { Common.ErrorMessage("MaxHandler for Start refers to state which can't be found, changing to hang up"); table.SetData(row, (int)TableColumns.MaxHandling.Goto, Strings.HangUpKeyword); } else if (oldUID != newUID) { table.SetData(row, (int)TableColumns.MaxHandling.Goto, newUID); } } SetMaxHandling(table); }
public static Table GetTableFromRows(BindingList <ResultsRow> rows) { Table table = new Table(rows.Count, 1); int row = 0; foreach (ResultsRow txt in rows) { table.SetData(row, 0, txt.Error); row++; } return(table); }
public override void OnConnectorLabelChange(ConnectorShadow shadow) { Table table = GetTransitions(); for (int r = 0; r < table.GetNumRows(); r++) { if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId())) { string condition = table.GetData(r, (int)TableColumns.Transitions.Condition); string newCondition = CommonShadow.GetStringWithNewConnectorLabel(condition, shadow.GetLabelName()); if (!condition.Equals(newCondition)) { table.SetData(r, (int)TableColumns.Transitions.Condition, newCondition); //table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table); } break; } } }
internal void SetSpecialSettings(Table table) { Table tmp = GetSpecialSettings(); if ((table.GetData(0, 0) == null || table.GetData(0, 0).Length == 0) && tmp.IsEmpty()) { return; } if (tmp.IsEmpty()) { //table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added Common.SetCellTable(shape, ShapeProperties.Play.SpecialSettings, table); } else if (!tmp.GetData(0, (int)TableColumns.SpecialSettings.Text).Equals(table.GetData(0, (int)TableColumns.SpecialSettings.Text))) { //table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added Common.SetCellTable(shape, ShapeProperties.Play.SpecialSettings, table); } }
public override void OnConnectorChangeTarget(ConnectorShadow shadow) { Table table = GetTransitions(); for (int r = 0; r < table.GetNumRows(); r++) { if (table.GetData(r, (int)TableColumns.Transitions.Goto).Equals(shadow.GetUniqueId())) { //table.SetData(r, (int)TableColumns.Transitions.GotoDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(r, (int)TableColumns.Transitions.GotoDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table); break; } } }
public static Table GetTableFromRows(BindingList <ConfirmationPromptRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.ConfirmationPrompts)).Length); int row = 0; foreach (ConfirmationPromptRow cp in rows) { table.SetData(row, (int)TableColumns.ConfirmationPrompts.Option, cp.Option); table.SetData(row, (int)TableColumns.ConfirmationPrompts.Condition, cp.Condition); table.SetData(row, (int)TableColumns.ConfirmationPrompts.Wording, cp.Wording); table.SetData(row, (int)TableColumns.ConfirmationPrompts.Id, cp.Id); table.SetData(row, (int)TableColumns.ConfirmationPrompts.OptionDateStamp, cp.OptionDateStamp); table.SetData(row, (int)TableColumns.ConfirmationPrompts.ConditionDateStamp, cp.ConditionDateStamp); table.SetData(row, (int)TableColumns.ConfirmationPrompts.WordingDateStamp, cp.WordingDateStamp); table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, cp.IdDateStamp); row++; } return(table); }
public static Table GetTableFromRows(BindingList <PromptTypeRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.PromptTypes)).Length); int row = 0; foreach (PromptTypeRow pt in rows) { table.SetData(row, (int)TableColumns.PromptTypes.Type, pt.Type); table.SetData(row, (int)TableColumns.PromptTypes.Condition, pt.Condition); table.SetData(row, (int)TableColumns.PromptTypes.Wording, pt.Wording); table.SetData(row, (int)TableColumns.PromptTypes.Id, pt.Id); table.SetData(row, (int)TableColumns.PromptTypes.TypeDateStamp, pt.TypeDateStamp); table.SetData(row, (int)TableColumns.PromptTypes.ConditionDateStamp, pt.ConditionDateStamp); table.SetData(row, (int)TableColumns.PromptTypes.WordingDateStamp, pt.WordingDateStamp); table.SetData(row, (int)TableColumns.PromptTypes.IdDateStamp, pt.IdDateStamp); row++; } return(table); }
public override void FixUIDReferencesAfterPaste(Dictionary <string, string> oldGUIDToNewGUIDMap) { Table table = GetTransitions(); for (int row = table.GetNumRows() - 1; row >= 0; row--) { string oldUID = table.GetData(row, (int)TableColumns.Transitions.Goto); string newUID = CommonShadow.GetNewUIDAfterPaste(oldUID, oldGUIDToNewGUIDMap, false); if (newUID == null) { table.DeleteRow(row); } else if (oldUID != newUID) { table.SetData(row, (int)TableColumns.Transitions.Goto, newUID); } } SetTransitionsWithoutRemovingOutputsForDeletedTransitions(table); }
public static Table GetTableFromRows(BindingList <MaxHandlingRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.MaxHandling)).Length); int row = 0; foreach (MaxHandlingRow mh in rows) { table.SetData(row, (int)TableColumns.MaxHandling.Condition, mh.Condition); table.SetData(row, (int)TableColumns.MaxHandling.Count, mh.Count); table.SetData(row, (int)TableColumns.MaxHandling.Action, mh.Action); table.SetData(row, (int)TableColumns.MaxHandling.Goto, mh.Goto); table.SetData(row, (int)TableColumns.MaxHandling.CountDateStamp, mh.CountDateStamp); table.SetData(row, (int)TableColumns.MaxHandling.ActionDateStamp, mh.ActionDateStamp); table.SetData(row, (int)TableColumns.MaxHandling.GotoDateStamp, mh.GotoDateStamp); row++; } return(table); }
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); }
// changes fields which are A$$B to be A private static void FixDollarDollarTableFields(Shape shape, string cellName) { const string dataSeparator = "$$"; Table table = Common.GetCellTable(shape, cellName); if (!table.IsEmpty()) { for (int r = 0; r < table.GetNumRows(); r++) { for (int c = 0; c < table.GetNumColumns(); c++) { string data = table.GetData(r, c); if (data.Contains(dataSeparator)) { data = data.Substring(0, data.IndexOf(dataSeparator)); table.SetData(r, c, data); } } } Common.SetCellTable(shape, cellName, table); } }
public static Table GetTableFromRows(BindingList <TransitionRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.Transitions)).Length); int row = 0; foreach (TransitionRow ct in rows) { table.SetData(row, (int)TableColumns.Transitions.Action, ct.Action); table.SetData(row, (int)TableColumns.Transitions.Condition, ct.Condition); // leave the old actual goto data in place table.SetData(row, (int)TableColumns.Transitions.Goto, ct.GotoData_TreatAsDateStamp); table.SetData(row, (int)TableColumns.Transitions.ActionDateStamp, ct.ActionDateStamp); table.SetData(row, (int)TableColumns.Transitions.ConditionDateStamp, ct.ConditionDateStamp); table.SetData(row, (int)TableColumns.Transitions.GotoDateStamp, ct.GotoDateStamp); row++; } return(table); }
internal Table GetDefaultSettings() { Table table = Common.GetCellTable(shape, ShapeProperties.Start.DefaultSettings); if (table.IsEmpty()) { table = new Table(DefaultSettingsLabels.Length, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length); for (int row = 0; row < DefaultSettingsLabels.Length; row++) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, DefaultSettingsLabels[row]); table.SetData(row, (int)TableColumns.NameValuePairs.Value, DefaultSettingsValues[row]); table.SetData(row, (int)TableColumns.NameValuePairs.Notes, DefaultSettingsValues[row]); table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); } } return(table); }
private void UISpecResults_Load(string results) { Table table; int cnt = 0; int lastLine = 0; string[] splitLine = Regex.Split(results, "\r\n\n"); if (splitLine[splitLine.Length - 1].Equals("\r\n\r\n")) lastLine = splitLine.Length - 1; else lastLine = splitLine.Length; table = new Table(lastLine, 1); foreach (string line in splitLine) { if (cnt < lastLine) { table.SetData(cnt, 0, line); cnt++; } } BindingList<ResultsRow> eList = ResultsRow.GetRowsFromTable(table); UISpecResultsGridView.DataSource = eList; }
public static Table GetTableFromRows(BindingList<ResultsRow> rows) { Table table = new Table(rows.Count, 1); int row = 0; foreach (ResultsRow txt in rows) { table.SetData(row, 0, txt.Error); row++; } return table; }
private int RedoPromptIds(int startNumber, string promptIdFormat, Table table) { if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial)) { string stateId = GetStateId(); string statePrefix, stateNumber, stateName; 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.Prompts.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.DefaultPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString(); else newPromptId = statePrefix + stateNumber + Strings.PromptIdSeparationChar + Strings.DefaultPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString(); } else newPromptId = Strings.DefaultPromptLetter.ToString() + Strings.PromptIdSeparationChar + nextNum; if (!table.GetData(row, (int)TableColumns.Prompts.Id).Equals(newPromptId)) { table.SetData(row, (int)TableColumns.Prompts.Id, newPromptId); table.SetData(row, (int)TableColumns.Prompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); } nextNum++; } if (nextNum - 1 > 0) SetPrompts(table); 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.Prompts.Wording); if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString)) continue; table.SetData(row, (int)TableColumns.Prompts.Id, nextNum.ToString()); table.SetData(row, (int)TableColumns.Prompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); nextNum++; } if (nextNum - startNumber > 0) SetPrompts(table); return nextNum - startNumber; } else return 0; }
internal override void RedoHiddenDateMarkers() { //use this to force hidden date fields to be version numbers //Common.WarningMessage("START SHAPE: Starting to loop thru table records"); Table table = GetPromptTypes(); String lastVersionStamp = Strings.DefaultVersionStamp; String tempVersionStamp = ""; Boolean labelsUpdated = false; for (int r = 0; r < table.GetNumRows(); r++) { string wordingDateString = table.GetData(r, (int)TableColumns.PromptTypes.WordingDateStamp); string idDateString = table.GetData(r, (int)TableColumns.PromptTypes.IdDateStamp); if (wordingDateString != "" && wordingDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(wordingDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("START SHAPE: Wording Date was: " + wordingDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.PromptTypes.WordingDateStamp, tempVersionStamp); labelsUpdated = true; } } if (idDateString != "" && idDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(idDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("START SHAPE: ID Date was: " + idDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.PromptTypes.IdDateStamp, tempVersionStamp); labelsUpdated = true; } } } if (labelsUpdated) { SetPromptTypes(table);//JDK Uncomment later } labelsUpdated = false; table = GetConfirmationPrompts(); for (int r = 0; r < table.GetNumRows(); r++) { string wordingDateString = table.GetData(r, (int)TableColumns.ConfirmationPrompts.WordingDateStamp); string idDateString = table.GetData(r, (int)TableColumns.ConfirmationPrompts.IdDateStamp); if (wordingDateString != "" && wordingDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(wordingDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("START SHAPE: Conf Wording Date was: " + wordingDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.ConfirmationPrompts.WordingDateStamp, tempVersionStamp); labelsUpdated = true; } } if (idDateString != "" && idDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(idDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("START SHAPE: Conf ID Date was: " + idDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.ConfirmationPrompts.IdDateStamp, tempVersionStamp); labelsUpdated = true; } } } //Common.WarningMessage("START SHAPE: Completed process for this Interaction state"); if (labelsUpdated) { SetConfirmationPrompts(table); } labelsUpdated = false; table = GetInitialization(); for (int r = 0; r < table.GetNumRows(); r++) { string nameDateString = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp); string notesDateString = table.GetData(r, (int)TableColumns.NameValuePairs.NotesDateStamp); string valueDateString = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp); if (nameDateString != "" && nameDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(nameDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("START SHAPE: Conf Wording Date was: " + wordingDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.NameValuePairs.NameDateStamp, tempVersionStamp); labelsUpdated = true; } } if (notesDateString != "" && notesDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(notesDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("START SHAPE: Conf ID Date was: " + idDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.NameValuePairs.NotesDateStamp, tempVersionStamp); labelsUpdated = true; } } if (valueDateString != "" && valueDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(valueDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("START SHAPE: Conf ID Date was: " + idDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp, tempVersionStamp); labelsUpdated = true; } } } //Common.WarningMessage("START SHAPE: Completed process for this Interaction state"); if (labelsUpdated) { SetInitialization(table); } }
internal Table GetMaxHandling() { Table table = Common.GetCellTable(shape, ShapeProperties.Start.MaxHandling); if (table.IsEmpty()) { table = new Table(CommonShadow.MaxHandlingConditions.Length, Enum.GetNames(typeof(TableColumns.MaxHandling)).Length); for (int row = 0; row < CommonShadow.MaxHandlingConditions.Length; row++) { table.SetData(row, (int)TableColumns.MaxHandling.Condition, CommonShadow.MaxHandlingConditions[row]); table.SetData(row, (int)TableColumns.MaxHandling.Count, CommonShadow.MaxHandlingDefaultCounts[row]); table.SetData(row, (int)TableColumns.MaxHandling.Goto, CommonShadow.MaxHandlingDefaultGotos[row]); } } return table; }
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); } } } }
internal static Table UnloadDeveloperNotesTextBox(TextBox textBox) { Table table = new Table(1, 2); table.SetData(0, (int)TableColumns.DeveloperNotes.Text, textBox.Text); return table; }
internal static void SetTableDataAndDateIfNecessary(Table table, int row, string newValue, TableColumns.NameValuePairs valueColumn, TableColumns.NameValuePairs dateColumn) { string oldValue = table.GetData(row, (int)valueColumn); if (oldValue.Equals(newValue)) return; table.SetData(row, (int)valueColumn, newValue); table.SetData(row, (int)dateColumn, DateTime.Today.ToString(Strings.DateColumnFormatString)); }
internal static Table UnloadSpecialSettingsTextBox(TextBox textBox) { Table table = new Table(1, 2); table.SetData(0, (int)TableColumns.SpecialSettings.Text, textBox.Text); return table; }
internal Table GetDefaultSettings() { Table table = Common.GetCellTable(shape, ShapeProperties.Start.DefaultSettings); if (table.IsEmpty()) { table = new Table(DefaultSettingsLabels.Length, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length); for (int row = 0; row < DefaultSettingsLabels.Length; row++) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, DefaultSettingsLabels[row]); table.SetData(row, (int)TableColumns.NameValuePairs.Value, DefaultSettingsValues[row]); } } return table; }
public static Table GetTableFromRows(BindingList <StartCommandTransitionRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.CommandTransitions)).Length); int row = 0; foreach (StartCommandTransitionRow ct in rows) { table.SetData(row, (int)TableColumns.CommandTransitions.Action, ct.Action); table.SetData(row, (int)TableColumns.CommandTransitions.Condition, ct.Condition); table.SetData(row, (int)TableColumns.CommandTransitions.Confirm, ct.Confirm); table.SetData(row, (int)TableColumns.CommandTransitions.DTMF, ct.DTMF); table.SetData(row, (int)TableColumns.CommandTransitions.Goto, ct.Goto); table.SetData(row, (int)TableColumns.CommandTransitions.Option, ct.Option); table.SetData(row, (int)TableColumns.CommandTransitions.Vocab, ct.Vocab); table.SetData(row, (int)TableColumns.CommandTransitions.ActionDateStamp, ct.ActionDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.ConditionDateStamp, ct.ConditionDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.ConfirmDateStamp, ct.ConfirmDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.DTMFDateStamp, ct.DTMFDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.GotoDateStamp, ct.GotoDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.OptionDateStamp, ct.OptionDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.VocabDateStamp, ct.VocabDateStamp); row++; } return(table); }
//JDK this was added to help with highlight colors with multiple versions on the same day internal static String MaxVersionWithDateColumn(string version, Table table, int column) { String maxVersion = version; String tempVersionStampFix = ""; //double decimalValue = 0; for (int r = 0; r < table.GetNumRows(); r++) { String lastVersionStamp = table.GetData(r, column); //NEW CODE STARTS HERE //if (lastVersionStamp.Trim().IndexOf("/")>=0 || lastVersionStamp.Trim().Equals("")) String tempCleanedVerLabel = CleanupVersionLabel(lastVersionStamp); if (!tempCleanedVerLabel.Equals(lastVersionStamp)) { DateTime tempDTStamp; if (DateTime.TryParse(lastVersionStamp, out tempDTStamp)) { tempVersionStampFix = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(tempDTStamp); lastVersionStamp = tempVersionStampFix; //lastVersionStamp = PathMaker.LookupChangeLogShadow().GetValidVersionString(PathMaker.LookupChangeLogShadow().GetChangeLog(), tempVersionStampFix); table.SetData(r, column, lastVersionStamp);//JDK temporarily removed for testing } } if (Common.ForcedStringVersionToDouble(lastVersionStamp) > Common.ForcedStringVersionToDouble(maxVersion)) maxVersion = lastVersionStamp; //NEW CODE ENDS HERE } return maxVersion; }
public static Table GetTableFromRows(BindingList<PromptTypeRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.PromptTypes)).Length); int row = 0; foreach (PromptTypeRow pt in rows) { table.SetData(row, (int)TableColumns.PromptTypes.Type, pt.Type); table.SetData(row, (int)TableColumns.PromptTypes.Condition, pt.Condition); table.SetData(row, (int)TableColumns.PromptTypes.Wording, pt.Wording); table.SetData(row, (int)TableColumns.PromptTypes.Id, pt.Id); table.SetData(row, (int)TableColumns.PromptTypes.TypeDateStamp, pt.TypeDateStamp); table.SetData(row, (int)TableColumns.PromptTypes.ConditionDateStamp, pt.ConditionDateStamp); table.SetData(row, (int)TableColumns.PromptTypes.WordingDateStamp, pt.WordingDateStamp); table.SetData(row, (int)TableColumns.PromptTypes.IdDateStamp, pt.IdDateStamp); row++; } return table; }
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]; 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)); } 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)); nextNum++; } return nextNum - startNumber; } else return 0; }
public static Table GetTableFromRows(BindingList<MaxHandlingRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.MaxHandling)).Length); int row = 0; foreach (MaxHandlingRow mh in rows) { table.SetData(row, (int)TableColumns.MaxHandling.Condition, mh.Condition); table.SetData(row, (int)TableColumns.MaxHandling.Count, mh.Count); table.SetData(row, (int)TableColumns.MaxHandling.Action, mh.Action); table.SetData(row, (int)TableColumns.MaxHandling.Goto, mh.Goto); table.SetData(row, (int)TableColumns.MaxHandling.CountDateStamp, mh.CountDateStamp); table.SetData(row, (int)TableColumns.MaxHandling.ActionDateStamp, mh.ActionDateStamp); table.SetData(row, (int)TableColumns.MaxHandling.GotoDateStamp, mh.GotoDateStamp); row++; } return table; }
internal Table GetDefaultSettings() { Table table = Common.GetCellTable(shape, ShapeProperties.Start.DefaultSettings); if (table.IsEmpty()) { table = new Table(DefaultSettingsLabels.Length, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length); for (int row = 0; row < DefaultSettingsLabels.Length; row++) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, DefaultSettingsLabels[row]); table.SetData(row, (int)TableColumns.NameValuePairs.Value, DefaultSettingsValues[row]); table.SetData(row, (int)TableColumns.NameValuePairs.Notes, DefaultSettingsValues[row]); table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion()); } } return table; }
public static Table GetTableFromRows(BindingList<TransitionRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.Transitions)).Length); int row = 0; foreach (TransitionRow ct in rows) { table.SetData(row, (int)TableColumns.Transitions.Action, ct.Action); table.SetData(row, (int)TableColumns.Transitions.Condition, ct.Condition); // leave the old actual goto data in place table.SetData(row, (int)TableColumns.Transitions.Goto, ct.GotoData_TreatAsDateStamp); table.SetData(row, (int)TableColumns.Transitions.ActionDateStamp, ct.ActionDateStamp); table.SetData(row, (int)TableColumns.Transitions.ConditionDateStamp, ct.ConditionDateStamp); table.SetData(row, (int)TableColumns.Transitions.GotoDateStamp, ct.GotoDateStamp); row++; } return table; }
internal void SetDeveloperNotes(Table table) { Table tmp = GetDeveloperNotes(); if ((table.GetData(0, 0) == null || table.GetData(0, 0).Length == 0) && tmp.IsEmpty()) return; if (tmp.IsEmpty()) { table.SetData(0, (int)TableColumns.DeveloperNotes.TextDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); Common.SetCellTable(shape, ShapeProperties.DeveloperNotes, table); } else if (!tmp.GetData(0, (int)TableColumns.DeveloperNotes.Text).Equals(table.GetData(0, (int)TableColumns.DeveloperNotes.Text))) { table.SetData(0, (int)TableColumns.DeveloperNotes.TextDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); Common.SetCellTable(shape, ShapeProperties.DeveloperNotes, table); } }
public static Table GetTableFromRows(BindingList<ConfirmationPromptRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.ConfirmationPrompts)).Length); int row = 0; foreach (ConfirmationPromptRow cp in rows) { table.SetData(row, (int)TableColumns.ConfirmationPrompts.Option, cp.Option); table.SetData(row, (int)TableColumns.ConfirmationPrompts.Condition, cp.Condition); table.SetData(row, (int)TableColumns.ConfirmationPrompts.Wording, cp.Wording); table.SetData(row, (int)TableColumns.ConfirmationPrompts.Id, cp.Id); table.SetData(row, (int)TableColumns.ConfirmationPrompts.OptionDateStamp, cp.OptionDateStamp); table.SetData(row, (int)TableColumns.ConfirmationPrompts.ConditionDateStamp, cp.ConditionDateStamp); table.SetData(row, (int)TableColumns.ConfirmationPrompts.WordingDateStamp, cp.WordingDateStamp); table.SetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp, cp.IdDateStamp); row++; } return table; }
internal override void RedoHiddenDateMarkers(StateShadow stateShadow) { //use this to force hidden date fields to be version numbers //Common.WarningMessage("PLAY SHADOW: Starting to loop thru table records"); Table table = GetPrompts(); String lastVersionStamp = base.GetLastChangeVersion(); String tempVersionStamp = ""; Boolean labelsUpdated = false; for (int r = 0; r < table.GetNumRows(); r++) { string wordingDateString = table.GetData(r, (int)TableColumns.Prompts.WordingDateStamp); string idDateString = table.GetData(r, (int)TableColumns.Prompts.IdDateStamp); if (!wordingDateString.Equals("") && wordingDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(wordingDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("PLAY: Wording Date was: " + wordingDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.Prompts.WordingDateStamp, tempVersionStamp); labelsUpdated = true; } } if (!idDateString.Equals("") && idDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(idDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("PLAY: ID Date was: " + idDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.Prompts.IdDateStamp, tempVersionStamp); labelsUpdated = true; } } } if (labelsUpdated) { SetPrompts(table); } table = GetTransitions(); for (int r = 0; r < table.GetNumRows(); r++) { string actionDateString = table.GetData(r, (int)TableColumns.Transitions.ActionDateStamp); string conditionDateString = table.GetData(r, (int)TableColumns.Transitions.ConditionDateStamp); string gotoDateString = table.GetData(r, (int)TableColumns.Transitions.GotoDateStamp); if (!actionDateString.Equals("") && actionDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(actionDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("PLAY: Wording Date was: " + actionDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.Transitions.ActionDateStamp, tempVersionStamp); labelsUpdated = true; } } if (!conditionDateString.Equals("") && conditionDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(conditionDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("PLAY: ID Date was: " + idDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.Transitions.ConditionDateStamp, tempVersionStamp); labelsUpdated = true; } } if (!gotoDateString.Equals("") && gotoDateString.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(gotoDateString, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //Common.WarningMessage("PLAY: ID Date was: " + idDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.Transitions.GotoDateStamp, tempVersionStamp); labelsUpdated = true; } } } if (labelsUpdated) { SetTransitions(table); } labelsUpdated = false; table = GetDeveloperNotes(); for (int r = 0; r < table.GetNumRows(); r++) { string textDateStamp = table.GetData(r, (int)TableColumns.DeveloperNotes.TextDateStamp); if (textDateStamp.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(textDateStamp, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //.WarningMessage("INTERACTION: Conf Wording Date was: " + wordingDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.DeveloperNotes.TextDateStamp, tempVersionStamp); labelsUpdated = true; } } } if (labelsUpdated) { SetDeveloperNotes(table); } labelsUpdated = false; table = GetSpecialSettings(); for (int r = 0; r < table.GetNumRows(); r++) { string textDateStamp = table.GetData(r, (int)TableColumns.SpecialSettings.TextDateStamp); if (textDateStamp.Contains("/")) { DateTime revisionDate; if (DateTime.TryParse(textDateStamp, out revisionDate)) { tempVersionStamp = PathMaker.LookupChangeLogShadow().GetVersionStringForChange(revisionDate); //.WarningMessage("INTERACTION: Conf Wording Date was: " + wordingDateString + " and label update is: " + tempVersionStamp); table.SetData(r, (int)TableColumns.SpecialSettings.TextDateStamp, tempVersionStamp); labelsUpdated = true; } } } if (labelsUpdated) { SetSpecialSettings(table); } }
public static Table GetTableFromRows(BindingList<NameValuePairRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.NameValuePairs)).Length); Boolean newStartStep = false; //Version 1.6.1.13+ uses a new set of fields for init data NV pairs - Notes column was added JDK 08-25-2014 if (table.GetNumColumns() >= 5) { newStartStep = true; } if (newStartStep) { int row = 0; foreach (NameValuePairRow nv in rows) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name); table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value); table.SetData(row, (int)TableColumns.NameValuePairs.Notes, nv.Notes); table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp); table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp); table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, nv.NotesDateStamp); row++; } } else { int row = 0; foreach (NameValuePairRow nv in rows) { table.SetData(row, (int)TableColumns.NameValuePairs.Name, nv.Name); table.SetData(row, (int)TableColumns.NameValuePairs.Value, nv.Value); //table.SetData(row, (int)TableColumns.NameValuePairs.Notes, nv.Notes); table.SetData(row, (int)TableColumns.NameValuePairs.NameDateStamp, nv.NameDateStamp); table.SetData(row, (int)TableColumns.NameValuePairs.ValueDateStamp, nv.ValueDateStamp); //table.SetData(row, (int)TableColumns.NameValuePairs.NotesDateStamp, nv.NotesDateStamp); row++; } } return table; }
private int RedoPromptIds(int startNumber, string promptIdFormat, Table table) { if (promptIdFormat.Equals(Strings.PromptIdFormatFull) || promptIdFormat.Equals(Strings.PromptIdFormatPartial)) { string stateId = GetStateId(); string statePrefix, stateNumber, stateName; 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.Prompts.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.DefaultPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString(); } else { newPromptId = statePrefix + stateNumber + Strings.PromptIdSeparationChar + Strings.DefaultPromptLetter + Strings.PromptIdSeparationChar + nextNum.ToString(); } } else { newPromptId = Strings.DefaultPromptLetter.ToString() + Strings.PromptIdSeparationChar + nextNum; } if (!table.GetData(row, (int)TableColumns.Prompts.Id).Equals(newPromptId)) { table.SetData(row, (int)TableColumns.Prompts.Id, newPromptId); //table.SetData(row, (int)TableColumns.Prompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(row, (int)TableColumns.Prompts.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added } nextNum++; } if (nextNum - 1 > 0) { SetPrompts(table); } 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.Prompts.Wording); if (wording == null || wording.Length == 0 || wording.Trim().StartsWith(Strings.CalculatedPromptStartString) || wording.Trim().StartsWith(Strings.PromptTypeMacroStartString)) { continue; } table.SetData(row, (int)TableColumns.Prompts.Id, nextNum.ToString()); //table.SetData(row, (int)TableColumns.Prompts.IdDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(row, (int)TableColumns.Prompts.IdDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added nextNum++; } if (nextNum - startNumber > 0) { SetPrompts(table); } return(nextNum - startNumber); } else { return(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); } }
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; }
internal static void SetTableDataAndDateIfNecessary(Table table, int row, string newValue, TableColumns.NameValuePairs valueColumn, TableColumns.NameValuePairs dateColumn) { string oldValue = table.GetData(row, (int)valueColumn); if (oldValue.Equals(newValue)) return; table.SetData(row, (int)valueColumn, newValue); //table.SetData(row, (int)dateColumn, DateTime.Today.ToString(Strings.DateColumnFormatString)); if (table.GetData(0,0) != "Mode") { table.SetData(row, (int)dateColumn, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added this to fix highlighting by version } }
public static Table GetTableFromRows(BindingList<StartCommandTransitionRow> rows) { Table table = new Table(rows.Count, Enum.GetNames(typeof(TableColumns.CommandTransitions)).Length); int row = 0; foreach (StartCommandTransitionRow ct in rows) { table.SetData(row, (int)TableColumns.CommandTransitions.Action, ct.Action); table.SetData(row, (int)TableColumns.CommandTransitions.Condition, ct.Condition); table.SetData(row, (int)TableColumns.CommandTransitions.Confirm, ct.Confirm); table.SetData(row, (int)TableColumns.CommandTransitions.DTMF, ct.DTMF); table.SetData(row, (int)TableColumns.CommandTransitions.Goto, ct.Goto); table.SetData(row, (int)TableColumns.CommandTransitions.Option, ct.Option); table.SetData(row, (int)TableColumns.CommandTransitions.Vocab, ct.Vocab); table.SetData(row, (int)TableColumns.CommandTransitions.ActionDateStamp, ct.ActionDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.ConditionDateStamp, ct.ConditionDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.ConfirmDateStamp, ct.ConfirmDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.DTMFDateStamp, ct.DTMFDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.GotoDateStamp, ct.GotoDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.OptionDateStamp, ct.OptionDateStamp); table.SetData(row, (int)TableColumns.CommandTransitions.VocabDateStamp, ct.VocabDateStamp); row++; } return table; }
internal void SetSpecialSettings(Table table) { Table tmp = GetSpecialSettings(); if ((table.GetData(0, 0) == null || table.GetData(0, 0).Length == 0) && tmp.IsEmpty()) return; if (tmp.IsEmpty()) { //table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added Common.SetCellTable(shape, ShapeProperties.Play.SpecialSettings, table); } else if (!tmp.GetData(0, (int)TableColumns.SpecialSettings.Text).Equals(table.GetData(0, (int)TableColumns.SpecialSettings.Text))) { //table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, DateTime.Now.ToString(Strings.DateColumnFormatString)); table.SetData(0, (int)TableColumns.SpecialSettings.TextDateStamp, PathMaker.LookupChangeLogShadow().GetLastChangeVersion());//JDK added Common.SetCellTable(shape, ShapeProperties.Play.SpecialSettings, table); } }