Exemplo n.º 1
0
        public DataView CreateDataView(DataTable table) {
            if (dataSet == null)
                throw ExceptionBuilder.CanNotUseDataViewManager();

            DataView dataView = new DataView(table);
            dataView.SetDataViewManager(this);
            return dataView;
        }
Exemplo n.º 2
0
        public DataView CreateDataView(DataTable table)
        {
            if (this.dataSet == null)
            {
                throw ExceptionBuilder.CanNotUseDataViewManager();
            }
            DataView view = new DataView(table);

            view.SetDataViewManager(this);
            return(view);
        }
Exemplo n.º 3
0
        PropertyDescriptorCollection System.ComponentModel.ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors) {
            DataSet dataSet = DataSet;
            if (dataSet == null)
                throw ExceptionBuilder.CanNotUseDataViewManager();

            if (listAccessors == null || listAccessors.Length == 0) {
                return((ICustomTypeDescriptor)(new DataViewManagerListItemTypeDescriptor(this))).GetProperties();
            }
            else {
                DataTable table = dataSet.FindTable(null, listAccessors, 0);
                if (table != null) {
                    return table.GetPropertyDescriptorCollection(null);
                }
            }
            return new PropertyDescriptorCollection(null);
        }
Exemplo n.º 4
0
        /*
        string IBindingList.GetListName() {
            return ((System.Data.ITypedList)this).GetListName(null);
        }
        string IBindingList.GetListName(PropertyDescriptor[] listAccessors) {
            return ((System.Data.ITypedList)this).GetListName(listAccessors);
        }
        */

        // Microsoft: GetListName and GetItemProperties almost the same in DataView and DataViewManager
        string System.ComponentModel.ITypedList.GetListName(PropertyDescriptor[] listAccessors) {
            DataSet dataSet = DataSet;
            if (dataSet == null)
                throw ExceptionBuilder.CanNotUseDataViewManager();

            if (listAccessors == null || listAccessors.Length == 0) {
                return dataSet.DataSetName;
            }
            else {
                DataTable table = dataSet.FindTable(null, listAccessors, 0);
                if (table != null) {
                    return table.TableName;
                }
            }
            return String.Empty;
        }
Exemplo n.º 5
0
        string ITypedList.GetListName(PropertyDescriptor[] listAccessors)
        {
            System.Data.DataSet dataSet = this.DataSet;
            if (dataSet == null)
            {
                throw ExceptionBuilder.CanNotUseDataViewManager();
            }
            if ((listAccessors == null) || (listAccessors.Length == 0))
            {
                return(dataSet.DataSetName);
            }
            DataTable table = dataSet.FindTable(null, listAccessors, 0);

            if (table != null)
            {
                return(table.TableName);
            }
            return(string.Empty);
        }
Exemplo n.º 6
0
        PropertyDescriptorCollection ITypedList.GetItemProperties(PropertyDescriptor[] listAccessors)
        {
            System.Data.DataSet dataSet = this.DataSet;
            if (dataSet == null)
            {
                throw ExceptionBuilder.CanNotUseDataViewManager();
            }
            if ((listAccessors == null) || (listAccessors.Length == 0))
            {
                return(((ICustomTypeDescriptor) new DataViewManagerListItemTypeDescriptor(this)).GetProperties());
            }
            DataTable table = dataSet.FindTable(null, listAccessors, 0);

            if (table != null)
            {
                return(table.GetPropertyDescriptorCollection(null));
            }
            return(new PropertyDescriptorCollection(null));
        }