本文整理汇总了C#中PathMaker.Table.GetNumRows方法的典型用法代码示例。如果您正苦于以下问题:C# Table.GetNumRows方法的具体用法?C# Table.GetNumRows怎么用?C# Table.GetNumRows使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathMaker.Table
的用法示例。
在下文中一共展示了Table.GetNumRows方法的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<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;
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: GetRowsFromTable
public static BindingList<NameValuePairRow> GetRowsFromTable(Table table)
{
BindingList<NameValuePairRow> list = new BindingList<NameValuePairRow>();
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)
{
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.Notes = table.GetData(r, (int)TableColumns.NameValuePairs.Notes);
nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
nv.NotesDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NotesDateStamp);
list.Add(nv);
}
} else {
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.Notes = "";
nv.NameDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.NameDateStamp);
nv.ValueDateStamp = table.GetData(r, (int)TableColumns.NameValuePairs.ValueDateStamp);
nv.NotesDateStamp = "";
list.Add(nv);
}
}
return list;
}
示例8: SetPrompts
internal void SetPrompts(Table table)
{
// once they've edited these - no longer allow edits of the shape text for prompts
Common.LockShapeText(shape.Shapes[promptShapeIndex]);
bool foundOne = false;
for (int row = 0; row < table.GetNumRows(); row++) {
string prompt = table.GetData(row, (int)TableColumns.Prompts.Wording);
if (prompt.Length > 0) {
Common.ForcedSetShapeText(shape.Shapes[promptShapeIndex], CommonShadow.PromptToShapeLabel(prompt));
foundOne = true;
break;
}
}
if (!foundOne)
Common.ForcedSetShapeText(shape.Shapes[promptShapeIndex], "");
Common.SetCellTable(shape, ShapeProperties.Play.Prompts, table);
}
示例9: 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;
}
示例10: 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;
}
示例11: AddPromptTypes
// parent could be an Interaction or a Start element
private static void AddPromptTypes(Table table, XmlElement parentElement)
{
if (table.IsEmpty())
return;
XmlElement promptTypeListElement = CreateElement(parentElement, xmlStrings.PromptTypeList);
for (int r = 0; r < table.GetNumRows(); r++) {
XmlElement promptTypeElement = CreateElement(promptTypeListElement, xmlStrings.PromptType);
XmlElement typeElement = CreateElement(promptTypeElement, xmlStrings.Type);
XmlElement promptListElement = CreateElement(promptTypeElement, xmlStrings.PromptList);
XmlElement promptElement = CreateElement(promptListElement, xmlStrings.Prompt);
XmlElement conditionElement = CreateElement(promptElement, xmlStrings.Condition);
XmlElement wordingElement = CreateElement(promptElement, xmlStrings.Wording);
XmlElement promptIdElement = CreateElement(promptElement, xmlStrings.PromptId);
string type = table.GetData(r, (int)TableColumns.PromptTypes.Type);
typeElement.InnerText = type;
string condition = table.GetData(r, (int)TableColumns.PromptTypes.Condition);
int level = Common.GetConditionLevel(condition);
condition = condition.Replace(Strings.IndentCharacterString, "");
CreateCDataSection(conditionElement, condition);
conditionElement.SetAttribute(xmlStrings.Level, level.ToString());
string wording = Common.StripBracketLabels(table.GetData(r, (int)TableColumns.PromptTypes.Wording));
CreateCDataSection(wordingElement, wording);
string promptId = table.GetData(r, (int)TableColumns.PromptTypes.Id);
promptIdElement.InnerText = promptId;
}
}
示例12: AddNameValuePairs
private static void AddNameValuePairs(Table table, XmlElement parentElement, string elementName)
{
if (table == null)
return;
XmlElement defaultSettingsElement = CreateElement(parentElement, elementName);
for (int r = 0; r < table.GetNumRows(); r++) {
XmlElement nvPairElement = CreateElement(defaultSettingsElement, xmlStrings.NameValuePair);
nvPairElement.SetAttribute(xmlStrings.Name, table.GetData(r, (int)TableColumns.NameValuePairs.Name));
nvPairElement.SetAttribute(xmlStrings.Value, table.GetData(r, (int)TableColumns.NameValuePairs.Value));
}
}
示例13: GetHighlightColorIndex
/*private static void SetCellBackgroundColorIfNecessary(Cell cell, string dateTime)
{
WdColorIndex index = GetHighlightColorIndex(dateTime);
if (index != WdColorIndex.wdNoHighlight)
cell.Range.Font.Shading.BackgroundPatternColorIndex = index;
}*/
private static void FillMaxHandling(Microsoft.Office.Interop.Word.Table wordTable, int wordTableBeginRow, Table table)
{
InsertWordTableRows(wordTable, wordTableBeginRow, table.GetNumRows() - 1);
for (int row = 0; row < table.GetNumRows(); row++) {
string condition = table.GetData(row, (int)TableColumns.MaxHandling.Condition);
string count = table.GetData(row, (int)TableColumns.MaxHandling.Count);
string action = table.GetData(row, (int)TableColumns.MaxHandling.Action);
string goingTo = table.GetData(row, (int)TableColumns.MaxHandling.Goto);
string countDate = table.GetData(row, (int)TableColumns.MaxHandling.CountDateStamp);
string actionDate = table.GetData(row, (int)TableColumns.MaxHandling.ActionDateStamp);
string goingToDate = table.GetData(row, (int)TableColumns.MaxHandling.GotoDateStamp);
if (count.Trim().Length == 0)
count = Strings.MaxHandlerGlobalReferenceNote;
if (action.Trim().Length == 0 && goingTo.Trim().Length == 0)
action = Strings.MaxHandlerGlobalReferenceNote;
Cell cell = wordTable.Cell(wordTableBeginRow + row, 1);
cell.Range.InsertAfter(condition);
cell = wordTable.Cell(wordTableBeginRow + row, 2);
cell.Range.InsertAfter(count);
SetCellBackgroundColorIfNecessary(cell, countDate);
BuildConditionActionGotoCell(wordTable.Cell(wordTableBeginRow + row, 3), "", "", action, actionDate, goingTo, goingToDate);
}
}
示例14: GetValidVersionString
/**
* Utility method to build an array of valid versions in the current revTable returns the array
*/
internal String GetValidVersionString(Table currentRevTable, String targetVersionMarker)
{
String validVersionString = "0.0";
String tempVersionString;
if (!currentRevTable.IsEmpty())
{
for (int i = 0; i < currentRevTable.GetNumRows(); i++)
{
tempVersionString = currentRevTable.GetData(i, (int)TableColumns.ChangeLog.Version);
if (tempVersionString.Trim() == targetVersionMarker.Trim())
{
validVersionString = targetVersionMarker;
return validVersionString;
}
}
}
return validVersionString;
}
示例15: 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;
}