本文整理汇总了C#中PathMaker.Table.GetData方法的典型用法代码示例。如果您正苦于以下问题:C# Table.GetData方法的具体用法?C# Table.GetData怎么用?C# Table.GetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathMaker.Table
的用法示例。
在下文中一共展示了Table.GetData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RedoConfirmationPromptIds
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;
}
示例2: GetRowsFromTable
public static BindingList<NameValuePairRow> GetRowsFromTable(Table table)
{
BindingList<NameValuePairRow> list = new BindingList<NameValuePairRow>();
for (int r = 0; r < table.GetNumRows(); r++) {
NameValuePairRow nv = new NameValuePairRow();
nv.Name = table.GetData(r, (int)TableColumns.NameValuePairs.Name);
nv.Value = table.GetData(r, (int)TableColumns.NameValuePairs.Value);
nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
list.Add(nv);
}
return list;
}
示例3: GetRowsFromTable
public static BindingList<ChangeLogRow> GetRowsFromTable(Table table)
{
BindingList<ChangeLogRow> list = new BindingList<ChangeLogRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
ChangeLogRow cl = new ChangeLogRow();
cl.Date = table.GetData(row, (int)TableColumns.ChangeLog.Date);
cl.Version = table.GetData(row, (int)TableColumns.ChangeLog.Version);
cl.Details = table.GetData(row, (int)TableColumns.ChangeLog.Details);
cl.Author = table.GetData(row, (int)TableColumns.ChangeLog.Author);
cl.Highlight = table.GetData(row, (int)TableColumns.ChangeLog.Highlight);
list.Add(cl);
}
return list;
}
示例4: GetRowsFromTable
public static BindingList<MaxHandlingRow> GetRowsFromTable(Table table)
{
BindingList<MaxHandlingRow> list = new BindingList<MaxHandlingRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
MaxHandlingRow mh = new MaxHandlingRow();
mh.Condition = table.GetData(row, (int)TableColumns.MaxHandling.Condition);
mh.Count = table.GetData(row, (int)TableColumns.MaxHandling.Count);
mh.Action = table.GetData(row, (int)TableColumns.MaxHandling.Action);
mh.Goto = table.GetData(row, (int)TableColumns.MaxHandling.Goto);
mh.CountDateStamp = table.GetData(row, (int)TableColumns.MaxHandling.CountDateStamp);
mh.ActionDateStamp = table.GetData(row, (int)TableColumns.MaxHandling.ActionDateStamp);
mh.GotoDateStamp = table.GetData(row, (int)TableColumns.MaxHandling.GotoDateStamp);
list.Add(mh);
}
return list;
}
示例5: GetRowsFromTable
public static BindingList<TransitionRow> GetRowsFromTable(Table table)
{
BindingList<TransitionRow> list = new BindingList<TransitionRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
TransitionRow ct = new TransitionRow();
ct.Action = table.GetData(row, (int)TableColumns.Transitions.Action);
ct.Condition = table.GetData(row, (int)TableColumns.Transitions.Condition);
// stash the real goto data in a hidden column
ct.GotoData_TreatAsDateStamp = table.GetData(row, (int)TableColumns.Transitions.Goto);
Shadow targetShadow = Common.GetGotoTargetFromData(ct.GotoData_TreatAsDateStamp);
if (targetShadow == null)
ct.Goto = ct.GotoData_TreatAsDateStamp;
else
ct.Goto = targetShadow.GetGotoName();
ct.ActionDateStamp = table.GetData(row, (int)TableColumns.Transitions.ActionDateStamp);
ct.ConditionDateStamp = table.GetData(row, (int)TableColumns.Transitions.ConditionDateStamp);
ct.GotoDateStamp = table.GetData(row, (int)TableColumns.Transitions.GotoDateStamp);
list.Add(ct);
}
return list;
}
示例6: GetRowsFromTable
public static BindingList<PromptRow> GetRowsFromTable(Table table)
{
BindingList<PromptRow> list = new BindingList<PromptRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
PromptRow pt = new PromptRow();
pt.Condition = table.GetData(row, (int)TableColumns.Prompts.Condition);
pt.Wording = table.GetData(row, (int)TableColumns.Prompts.Wording);
pt.Id = table.GetData(row, (int)TableColumns.Prompts.Id);
pt.ConditionDateStamp = table.GetData(row, (int)TableColumns.Prompts.ConditionDateStamp);
pt.WordingDateStamp = table.GetData(row, (int)TableColumns.Prompts.WordingDateStamp);
pt.IdDateStamp = table.GetData(row, (int)TableColumns.Prompts.IdDateStamp);
list.Add(pt);
}
return list;
}
示例7: MaxVersionWithDateColumn
//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;
}
示例8: MaxDateWithDateColumn
internal static DateTime MaxDateWithDateColumn(DateTime date, Table table, int column)
{
DateTime maxDate = date;
for (int r = 0; r < table.GetNumRows(); r++) {
DateTime changeDate = ForcedStringToDate(table.GetData(r, column));
if (changeDate > maxDate)
maxDate = changeDate;
}
return maxDate;
}
示例9: FillPromptTypesTable
private static void FillPromptTypesTable(Microsoft.Office.Interop.Word.Table wordTable, int wordTableBeginRow, Table table)
{
// prompts with conditions get split over 2 rows - need to add extra for them
int conditionsWithPrompts = CountConditionsWithPrompts(table, (int)TableColumns.ConfirmationPrompts.Condition, (int)TableColumns.ConfirmationPrompts.Wording);
// There's already one row in the template, so always subtract 1
InsertWordTableRows(wordTable, wordTableBeginRow, table.GetNumRows() + conditionsWithPrompts - 1);
int level = 0;
int wordingLevel = 0;
int currentWordTableRow = wordTableBeginRow;
for (int row = 0; row < table.GetNumRows(); row++) {
string type = table.GetData(row, (int)TableColumns.PromptTypes.Type);
string condition = table.GetData(row, (int)TableColumns.PromptTypes.Condition);
string wording = Common.StripBracketLabels(table.GetData(row, (int)TableColumns.PromptTypes.Wording));
string id = table.GetData(row, (int)TableColumns.PromptTypes.Id);
string typeDate = table.GetData(row, (int)TableColumns.PromptTypes.TypeDateStamp);
string conditionDate = table.GetData(row, (int)TableColumns.PromptTypes.ConditionDateStamp);
string wordingDate = table.GetData(row, (int)TableColumns.PromptTypes.WordingDateStamp);
string idDate = table.GetData(row, (int)TableColumns.PromptTypes.IdDateStamp);
Cell cell = wordTable.Cell(currentWordTableRow, 1);
if (OptionOrPromptTypeEntriesSameAsPrevious(table, row, (int)TableColumns.ConfirmationPrompts.Option))
cell.Range.Borders[WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
else {
cell.Range.InsertAfter(Common.StripBracketLabels(type));
level = 0;
wordingLevel = 0;
}
SetCellBackgroundColorIfNecessary(cell, typeDate);
cell = wordTable.Cell(currentWordTableRow, 2);
if (condition.Length > 0) {
level = Common.GetConditionLevel(condition);
wordingLevel = level + 1;
}
condition = condition.Replace(Strings.IndentCharacterString, "").Trim();
if (condition.Length > 0) {
cell.Range.ParagraphFormat.IndentCharWidth((short)level);
cell.Range.InsertAfter(condition);
cell.Range.Font.Italic = 1;
SetCellBackgroundColorIfNecessary(cell, conditionDate);
}
if (wording.Length > 0) {
if (condition.Length > 0) {
// goes on a separate line after the condition row and indented
currentWordTableRow++;
// clear the border in column 1 so it looks like part of the one above
wordTable.Cell(currentWordTableRow, 1).Range.Borders[WdBorderType.wdBorderTop].LineStyle = WdLineStyle.wdLineStyleNone;
}
cell = wordTable.Cell(currentWordTableRow, 2);
cell.Range.ParagraphFormat.IndentCharWidth((short)wordingLevel);
cell.Range.InsertAfter(wording);
SetCellBackgroundColorIfNecessary(cell, wordingDate);
}
if (id.Length > 0) {
cell = wordTable.Cell(currentWordTableRow, 3);
cell.Range.InsertAfter(id);
SetCellBackgroundColorIfNecessary(cell, idDate);
}
currentWordTableRow++;
}
}
示例10: RedoPromptTypeIds
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;
}
示例11: RemoveOutputsIfNotInTableColumn
internal void RemoveOutputsIfNotInTableColumn(Table table, int gotoColumn)
{
List<Connect> connects = GetShapeOutputs();
List<Shadow> shadows = new List<Shadow>();
foreach (Connect connect in connects) {
// The 1D connector is always the To and 2D shapes are always the From
Shape toShape = connect.FromSheet;
Shadow shadow = PathMaker.LookupShadowByShape(toShape);
shadows.Add(shadow);
}
for (int row = 0; row < table.GetNumRows(); row++) {
string uid = table.GetData(row, gotoColumn);
Shadow shadow = PathMaker.LookupShadowByUID(uid);
if (shadow != null)
shadows.Remove(shadow);
}
if (shadows.Count > 0) {
foreach (Shadow shadow in shadows)
shadow.shape.Delete();
}
}
示例12: GetRowsFromTable
public static BindingList<ConfirmationPromptRow> GetRowsFromTable(Table table)
{
BindingList<ConfirmationPromptRow> list = new BindingList<ConfirmationPromptRow>();
for (int row = 0; row < table.GetNumRows(); row++) {
ConfirmationPromptRow cp = new ConfirmationPromptRow();
cp.Option = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Option);
cp.Condition = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Condition);
cp.Wording = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Wording);
cp.Id = table.GetData(row, (int)TableColumns.ConfirmationPrompts.Id);
cp.OptionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.OptionDateStamp);
cp.ConditionDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.ConditionDateStamp);
cp.WordingDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.WordingDateStamp);
cp.IdDateStamp = table.GetData(row, (int)TableColumns.ConfirmationPrompts.IdDateStamp);
list.Add(cp);
}
return list;
}
示例13: GetRowsFromTable
public static BindingList<ResultsRow> GetRowsFromTable(Table table)
{
BindingList<ResultsRow> list = new BindingList<ResultsRow>();
for (int r = 0; r < table.GetNumRows(); r++) {
ResultsRow txt = new ResultsRow();
txt.Error = table.GetData(r, 0);
list.Add(txt);
}
return list;
}
示例14: CountConditionsWithPrompts
private static int CountConditionsWithPrompts(Table table, int conditionColumn, int wordingColumn)
{
int count = 0;
for (int r = 0; r < table.GetNumRows(); r++) {
string condition = table.GetData(r, conditionColumn);
string wording = table.GetData(r, wordingColumn);
condition = condition.Replace(Strings.IndentCharacterString, "").Trim();
if (condition.Length > 0 && wording.Length > 0)
count++;
}
return count;
}
示例15: AddMaxHandlingToCache
private static void AddMaxHandlingToCache(string source, Table table)
{
for (int row = 0; row < table.GetNumRows(); row++) {
string gotoData = table.GetData(row, (int)TableColumns.MaxHandling.Goto);
if (gotoData == null || gotoData.Length == 0)
continue;
Shadow targetShadow = Common.GetGotoTargetFromData(gotoData);
string targetName;
if (targetShadow != null) {
targetName = CachedGetGotoName(targetShadow);
List<string> fromStates;
if (gotoMaxHandlerCache.TryGetValue(targetName, out fromStates))
fromStates.Add(source);
else {
fromStates = new List<string>();
fromStates.Add(source);
gotoMaxHandlerCache.Add(targetName, fromStates);
}
}
}
}