Exemplo n.º 1
0
        // TODO: Do we need this? We already take an IEnumerable<T> and IList<T> implements IEnumerable<T>
        //public EndEditWrapper(List<T> list)
        //{
        //    foreach(T item in list)
        //    {
        //        // This calls insert and thereby we attach our handler to each item's ItemEndEdit event.
        //        Add(item);
        //    }
        //}

        public EndEditWrapper(IEnumerable <T> collection, BetterLCVCreatorDelegate <T> betterLCVCreatorDelegate)
        {
            _betterListCollViewCreator = betterLCVCreatorDelegate;

            foreach (T item in collection)
            {
                // This calls insert and thereby we attach our handler to each item's ItemEndEdit event.
                Add(item);
            }
        }
Exemplo n.º 2
0
        // TODO: Get rid of this constructor.
        public ClrMappedDSP(IDoCRUD <T> dataAccessLayerSimple, BetterLCVCreatorDelegate <T> betterLCVCreatorDelegate /*, bool isAsynchronous*/)
        {
            _dataAccessLayerSimple = dataAccessLayerSimple;

            if (dataAccessLayerSimple is IDoCrudWithMapping <T> dalWithMapping)
            {
                _dataAccessLayerWithMapping = dalWithMapping;
            }
            _betterLCVCreatorDelegate = betterLCVCreatorDelegate;
            //IsAsynchronous = isAsynchronous;

            dataAccessLayerSimple.DataSourceChanged += _dataAccessLayer_DataSourceChanged;
        }
Exemplo n.º 3
0
        public ClrMappedDSP(IDoCrudWithMapping <T> dataAccessLayer, BetterLCVCreatorDelegate <T> betterLCVCreatorDelegate /*, bool isAsynchronous*/)
        {
            _dataAccessLayerWithMapping = dataAccessLayer;
            _betterLCVCreatorDelegate   = betterLCVCreatorDelegate;
            //IsAsynchronous = isAsynchronous;

            _dataAccessLayerSimple = dataAccessLayer as IDoCRUD <T>;
            if (_dataAccessLayerSimple == null)
            {
                throw new InvalidOperationException($"The dataAccessLayer ({nameof(IDoCrudWithMapping<T>)}) does not implement {nameof(IDoCRUD<T>)}.");
            }

            // TODO: Consider adding a DataSourceChanged event declaration on the IDoCrudWithMapping<T> interface.
            _dataAccessLayerSimple.DataSourceChanged += _dataAccessLayer_DataSourceChanged;
        }