本文整理汇总了C#中PathMaker.Table.GetNumColumns方法的典型用法代码示例。如果您正苦于以下问题:C# Table.GetNumColumns方法的具体用法?C# Table.GetNumColumns怎么用?C# Table.GetNumColumns使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PathMaker.Table
的用法示例。
在下文中一共展示了Table.GetNumColumns方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: GetTableFromRows
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;
}