本文整理匯總了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;
}