Ejemplo n.º 1
0
        /// <summary>
        /// Получает IBindingListView для этого набора объектов
        /// </summary>
        /// <returns></returns>
        private IBindingListView GetBindingList()
        {
            if (_list != null)
            {
                return(_list);
            }
            var listType = typeof(EntityBindingList <>);

            listType = listType.MakeGenericType(ElementType);
            _list    = (IEntityBindingList)Activator.CreateInstance(listType, DataSource, Query, Guid.NewGuid().ToString());// this.Name);

            _list.ListChanged += _list_ListChanged;
            return(_list);
        }
Ejemplo n.º 2
0
        //-------------------------------------------------------------------------
        #region ** implementation

        // gets an IBindingListView for this entity set
        IBindingListView GetBindingList()
        {
            if (_list == null)
            {
                // create the list
                var listType = typeof(EntityBindingList <>);
                listType = listType.MakeGenericType(this.ElementType);
                _list    = (IEntityBindingList)Activator.CreateInstance(listType, _ds, this.Query, Guid.NewGuid().ToString());// this.Name);

                // and listen to changes in the new list
                _list.ListChanged += _list_ListChanged;
            }
            return(_list);
        }