本文整理汇总了C#中Table.Apply方法的典型用法代码示例。如果您正苦于以下问题:C# Table.Apply方法的具体用法?C# Table.Apply怎么用?C# Table.Apply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Table
的用法示例。
在下文中一共展示了Table.Apply方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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));
}
示例2: ApplyingProcessorToSingleColumn
public void ApplyingProcessorToSingleColumn()
{
var table = new Table();
table.CreateColumn("percentage", new[] { 1.0m, 0.8m, 0.35m });
table.Apply(new MultiplyPercentages());
var columnHeader = table.GetColumnHeader("percentage");
Assert.That(columnHeader.DataColumns.Count(), Is.EqualTo(2));
}
示例3: 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"));
}
示例4: 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"));
}