本文整理汇总了C#中TableInfo.AddColumnSafe方法的典型用法代码示例。如果您正苦于以下问题:C# TableInfo.AddColumnSafe方法的具体用法?C# TableInfo.AddColumnSafe怎么用?C# TableInfo.AddColumnSafe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TableInfo
的用法示例。
在下文中一共展示了TableInfo.AddColumnSafe方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Init
protected virtual void Init(IEnumerable<ITable> tables)
{
var tablesArray = tables.ToArray();
referenceList = tablesArray;
int colCount = ColumnCount;
indexes = new ColumnIndex[colCount];
vtTableInfo = new TableInfo(new ObjectName("#VIRTUAL TABLE#"));
// Generate look up tables for column_table and column_filter information
columnTable = new int[colCount];
columnFilter = new int[colCount];
int index = 0;
for (int i = 0; i < referenceList.Length; ++i) {
var curTable = referenceList[i];
var curTableInfo = curTable.TableInfo;
int refColCount = curTable.ColumnCount();
// For each column
for (int n = 0; n < refColCount; ++n) {
columnFilter[index] = n;
columnTable[index] = i;
++index;
// Add this column to the data table info of this table.
var columnInfo = curTableInfo[n];
var newColumnInfo = new ColumnInfo(columnInfo.ColumnName, columnInfo.ColumnType) {
DefaultExpression = columnInfo.DefaultExpression,
IsNotNull = columnInfo.IsNotNull,
IndexType = columnInfo.IndexType
};
vtTableInfo.AddColumnSafe(newColumnInfo);
}
}
vtTableInfo = vtTableInfo.AsReadOnly();
}
示例2: SetColumnMap
private void SetColumnMap(int[] mapping)
{
reverseColumnMap = new int[Parent.ColumnCount()];
for (int i = 0; i < reverseColumnMap.Length; ++i) {
reverseColumnMap[i] = -1;
}
var parentInfo = Parent.TableInfo;
subsetTableInfo = new TableInfo(parentInfo.TableName);
for (int i = 0; i < mapping.Length; ++i) {
int mapTo = mapping[i];
var origColumnInfo = Parent.TableInfo[mapTo];
var columnInfo = new ColumnInfo(aliases[i].Name, origColumnInfo.ColumnType) {
DefaultExpression = origColumnInfo.DefaultExpression,
IsNotNull = origColumnInfo.IsNotNull,
IndexType = origColumnInfo.IndexType
};
subsetTableInfo.AddColumnSafe(columnInfo);
reverseColumnMap[mapTo] = i;
}
subsetTableInfo = subsetTableInfo.AsReadOnly();
}