Пример #1
0
 protected override void Dispose(bool disposing)
 {
     if (_disposed)
     {
         return;
     }
     if (disposing)
     {
         _output.Dispose();
     }
     _disposed = true;
     base.Dispose(disposing);
 }
Пример #2
0
            public Cursor(IChannelProvider provider, RowToRowScorerBase parent, RowCursor input, bool[] active, Func <int, bool> predicateMapper)
                : base(provider, input)
            {
                Ch.AssertValue(parent);
                Ch.AssertValue(active);
                Ch.AssertValue(predicateMapper);

                _bindings = parent.GetBindings();
                Schema    = parent.OutputSchema;
                Ch.Assert(active.Length == _bindings.ColumnCount);
                _active = active;

                _output = _bindings.RowMapper.GetRow(input, predicateMapper);
                try
                {
                    Ch.Assert(_output.Schema == _bindings.RowMapper.OutputSchema);
                    _getters = parent.GetGetters(_output, iinfo => active[_bindings.MapIinfoToCol(iinfo)]);
                }
                catch (Exception)
                {
                    _output.Dispose();
                    throw;
                }
            }