Ejemplo n.º 1
0
            public RowCursor(IChannelProvider provider, OneToOneTransformBase parent, IRowCursor input, bool[] active)
                : base(provider, input)
            {
                Ch.AssertValue(parent);
                Ch.Assert(active == null || active.Length == parent._bindings.ColumnCount);

                _bindings = parent._bindings;
                _active   = active;
                _getters  = new Delegate[parent.Infos.Length];

                // Build the delegates.
                List <Action> disposers = null;

                for (int iinfo = 0; iinfo < _getters.Length; iinfo++)
                {
                    if (!IsColumnActive(parent._bindings.MapIinfoToCol(iinfo)))
                    {
                        continue;
                    }
                    Action disposer;
                    _getters[iinfo] = parent.GetGetterCore(Ch, Input, iinfo, out disposer);
                    if (disposer != null)
                    {
                        Utils.Add(ref disposers, disposer);
                    }
                }

                if (Utils.Size(disposers) > 0)
                {
                    _disposers = disposers.ToArray();
                }
            }
Ejemplo n.º 2
0
            public Cursor(IChannelProvider provider, OneToOneTransformBase parent, RowCursor input, bool[] active)
                : base(provider, input)
            {
                Ch.AssertValue(parent);
                Ch.Assert(active == null || active.Length == parent._bindings.ColumnCount);

                _bindings = parent._bindings;
                _active   = active;
                _getters  = new Delegate[parent.Infos.Length];

                // Build the disposing delegate.
                Action masterDisposer = null;

                for (int iinfo = 0; iinfo < _getters.Length; iinfo++)
                {
                    if (!IsColumnActive(parent._bindings.MapIinfoToCol(iinfo)))
                    {
                        continue;
                    }
                    _getters[iinfo] = parent.GetGetterCore(Ch, Input, iinfo, out Action disposer);
                    if (disposer != null)
                    {
                        masterDisposer += disposer;
                    }
                }
                _disposer = masterDisposer;
            }