Ejemplo n.º 1
0
            /// <summary>
            /// Returns a value getter delegate to fetch the value of column with the given columnIndex, from the row.
            /// This throws if the column is not active in this row, or if the type
            /// <typeparamref name="TValue"/> differs from this column's type.
            /// </summary>
            /// <typeparam name="TValue"> is the column's content type.</typeparam>
            /// <param name="column"> is the output column whose getter should be returned.</param>
            public override ValueGetter <TValue> GetGetter <TValue>(DataViewSchema.Column column)
            {
                Ch.CheckParam(IsColumnActive(column), nameof(column), "requested column not active");

                var getter = _getters[_colToActivesIndex[column.Index]] as ValueGetter <TValue>;

                if (getter == null)
                {
                    throw Ch.Except("Invalid TValue: '{0}'", typeof(TValue));
                }

                return(getter);
            }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns whether the given column is active in this row.
 /// </summary>
 public override bool IsColumnActive(DataViewSchema.Column column)
 {
     Ch.CheckParam(column.Index < _colToActivesIndex.Length, nameof(column));
     return(_colToActivesIndex[column.Index] >= 0);
 }