本文整理汇总了C#中Table.GetData方法的典型用法代码示例。如果您正苦于以下问题:C# Table.GetData方法的具体用法?C# Table.GetData怎么用?C# Table.GetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table.GetData方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetRowsFromTable
public static BindingList<PrefixListRow> GetRowsFromTable(Table table)
{
BindingList<PrefixListRow> list = new BindingList<PrefixListRow>();
for (int row = 0; row < table.GetNumRows(); row++)
{
PrefixListRow cl = new PrefixListRow();
cl.Prefix = table.GetData(row, (int)TableColumns.PrefixList.Prefix);
cl.Meaning = table.GetData(row, (int)TableColumns.PrefixList.Meaning);
list.Add(cl);
}
return list;
}
示例2: ApplyProcessorShort
public void ApplyProcessorShort()
{
var table = new Table();
var column = table.CreateColumn("nums", new int?[] { 3, 4, 5, 6, null, null, null, null, 3, 5 });
table.Apply(column, i => i * 2);
Assert.That(table.GetData(column).First(), Is.EqualTo(6));
}
示例3: ShouldCreateColumnWithoutData
public void ShouldCreateColumnWithoutData()
{
var table = new Table();
var columnDefinition = table.CreateColumn<string>("firstname");
Assert.That(columnDefinition.Name, Is.EqualTo("firstname"));
Assert.That(columnDefinition.UnderlyingType, Is.EqualTo(typeof(string)));
var data = table.GetData<string>("firstname");
Assert.That(data.Count(), Is.EqualTo(0));
}
示例4: ApplyingProcessorToEntireTableWithColumnsOfDifferentLengths
public void ApplyingProcessorToEntireTableWithColumnsOfDifferentLengths()
{
var table = new Table();
table.CreateColumn("firstname", new[] { "bob", "ben", "bill" });
table.CreateColumn("lastname", new[] { "smith", "jenkins" });
table.Apply(new GenerateFullName());
var fullnames = table.GetData<string>("fullname");
Assert.That(fullnames.Count(), Is.EqualTo(3));
Assert.That(fullnames.Last(), Is.EqualTo("bill unknown"));
}
示例5: ApplyingProcessorToEntireTable
public void ApplyingProcessorToEntireTable()
{
var table = new Table();
table.CreateColumn("firstname", new[] { "bob", "ben" });
table.CreateColumn("lastname", new[] { "smith", "jenkins" });
table.Apply(new GenerateFullName());
var fullnames = table.GetData<string>("fullname");
Assert.That(fullnames.Count(), Is.EqualTo(2));
Assert.That(fullnames.First(), Is.EqualTo("bob smith"));
}