本文整理汇总了C#中ITable.GetRawTableInfo方法的典型用法代码示例。如果您正苦于以下问题:C# ITable.GetRawTableInfo方法的具体用法?C# ITable.GetRawTableInfo怎么用?C# ITable.GetRawTableInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITable
的用法示例。
在下文中一共展示了ITable.GetRawTableInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Create
public static OuterTable Create(ITable inputTable)
{
var baseTable = inputTable.GetRawTableInfo();
var tables = baseTable.GetTables();
var rows = baseTable.GetRows();
return new OuterTable(tables, rows);
}
示例2: Union
public static ITable Union(this ITable thisTable, ITable otherTable)
{
// Optimizations - handle trivial case of row count in one of the tables
// being 0.
// NOTE: This optimization assumes this table and the unioned table are
// of the same type.
if ((thisTable.RowCount == 0 && otherTable.RowCount == 0) ||
otherTable.RowCount == 0) {
return thisTable;
}
if (thisTable.RowCount == 0)
return otherTable;
// First we merge this table with the input table.
var raw1 = thisTable.GetRawTableInfo();
var raw2 = otherTable.GetRawTableInfo();
// This will throw an exception if the table types do not match up.
var union = raw1.Union(raw2);
// Now 'union' contains a list of uniquely merged rows (ie. the union).
// Now make it into a new table and return the information.
var tableList = union.GetTables().AsEnumerable();
return new VirtualTable(tableList, union.GetRows());
}
示例3: MergeIn
public void MergeIn(ITable outsideTable)
{
var rawTableInfo = outsideTable.GetRawTableInfo();
// Get the base information,
var baseTables = ReferenceTables;
IList<int>[] baseRows = ReferenceRows;
// The tables and rows being merged in.
var tables = rawTableInfo.GetTables();
var rows = rawTableInfo.GetRows();
// The number of rows being merged in.
outerRowCount = rows[0].Count;
for (int i = 0; i < baseTables.Length; ++i) {
var btable = baseTables[i];
int index = -1;
for (int n = 0; n < tables.Length && index == -1; ++n) {
if (btable == tables[n]) {
index = n;
}
}
// If the table wasn't found, then set 'NULL' to this base_table
if (index == -1) {
outerRows[i] = null;
} else {
List<int> list = new List<int>(outerRowCount);
outerRows[i] = list;
// Merge in the rows from the input table,
IList<int> toMerge = rows[index];
if (toMerge.Count != outerRowCount)
throw new InvalidOperationException("Wrong size for rows being merged in.");
list.AddRange(toMerge);
}
}
}