Ejemplo n.º 1
0
        /// <summary>
        /// 读取当前行的所有数据并进行筛选,然后将筛选结果写入器数据写入器中。
        /// </summary>
        /// <param name="dataWriter">数据写入器</param>
        /// <param name="valueFilter">值筛选器</param>
        public void OnReadAll(IDataWriter <int> dataWriter, IValueFilter <int> valueFilter)
        {
            int length = dbDataReader.FieldCount;

            var valueInfo = new ValueFilterInfo <int>();

            for (int i = 0; i < length; i++)
            {
                OnReadValue(i, valueInfo.ValueCopyer);

                valueInfo.Key  = i;
                valueInfo.Type = valueInfo.ValueCopyer.Type;

                if (valueFilter.Filter(valueInfo))
                {
                    valueInfo.ValueCopyer.WriteTo(dataWriter[i]);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 读取当前行的所有数据并进行筛选,然后将筛选结果写入器数据写入器中。
        /// </summary>
        /// <param name="dataWriter">数据写入器</param>
        /// <param name="valueFilter">值筛选器</param>
        public void OnReadAll(IDataWriter <int> dataWriter, IValueFilter <int> valueFilter)
        {
            int length = dbDataReader.FieldCount;

            var valueInfo = new ValueFilterInfo <int>();

            for (int i = 0; i < length; i++)
            {
                var value = dbDataReader[i];

                ValueInterface.GetInterface(value).Write(valueInfo.ValueCopyer, value);

                valueInfo.Key  = i;
                valueInfo.Type = dbDataReader.GetFieldType(i);

                if (valueFilter.Filter(valueInfo))
                {
                    valueInfo.ValueCopyer.WriteTo(dataWriter[valueInfo.Key]);
                }
            }
        }
Ejemplo n.º 3
0
        public void OnReadAll(IDataWriter <int> dataWriter, IValueFilter <int> valueFilter)
        {
            int index = 0;

            var valueInfo = new ValueFilterInfo <int>();

            while (tableReader.Read())
            {
                valueInfo.ValueCopyer.WriteObject(tableReader);

                valueInfo.Key  = index;
                valueInfo.Type = tableReader.GetType();

                if (valueFilter.Filter(valueInfo))
                {
                    valueInfo.ValueCopyer.WriteTo(dataWriter[index]);
                }

                ++index;
            }
        }
Ejemplo n.º 4
0
 public bool Filter(ValueFilterInfo <TIn> valueInfo)
 {
     return(valueFilter.Filter(new ValueFilterInfo <TOut>(XConvert <TIn, TOut> .Convert(valueInfo.Key),
                                                          valueInfo.Type,
                                                          valueInfo.ValueCopyer)));
 }