public virtual DataViewSetting this[DataTable table]
 {
     get
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull(nameof(table));
         }
         DataViewSetting dataViewSetting = (DataViewSetting)_list[table];
         if (dataViewSetting == null)
         {
             dataViewSetting = new DataViewSetting();
             this[table]     = dataViewSetting;
         }
         return(dataViewSetting);
     }
     set
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull(nameof(table));
         }
         value.SetDataViewManager(_dataViewManager);
         value.SetDataTable(table);
         _list[table] = value;
     }
 }
示例#2
0
        private void ReadTableSetting(XmlReader reader)
        {
            // Namespace is ignored BTW.
            DataTable dt = DataSet.Tables [XmlConvert.DecodeName(
                                               reader.LocalName)];
            // The code below might result in NullReference error.
            DataViewSetting s    = settings [dt];
            string          sort = reader.GetAttribute("Sort");

            if (sort != null)
            {
                s.Sort = sort.Trim();
            }
            string ads = reader.GetAttribute("ApplyDefaultSort");

            if (ads != null && ads.Trim() == "true")
            {
                s.ApplyDefaultSort = true;
            }
            string rowFilter = reader.GetAttribute("RowFilter");

            if (rowFilter != null)
            {
                s.RowFilter = rowFilter.Trim();
            }
            string rsf = reader.GetAttribute("RowStateFilter");

            if (rsf != null)
            {
                s.RowStateFilter = (DataViewRowState)
                                   Enum.Parse(typeof(DataViewRowState),
                                              rsf.Trim());
            }
            reader.Skip();
        }
示例#3
0
 public virtual DataViewSetting this[DataTable table]
 {
     get
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull("table");
         }
         DataViewSetting setting = (DataViewSetting)this.list[table];
         if (setting == null)
         {
             setting     = new DataViewSetting();
             this[table] = setting;
         }
         return(setting);
     }
     set
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull("table");
         }
         value.SetDataViewManager(this.dataViewManager);
         value.SetDataTable(table);
         this.list[table] = value;
     }
 }
 public virtual DataViewSetting this[DataTable table]
 {
     get
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull(nameof(table));
         }
         DataViewSetting dataViewSetting = (DataViewSetting)_list[table];
         if (dataViewSetting == null)
         {
             dataViewSetting = new DataViewSetting();
             this[table] = dataViewSetting;
         }
         return dataViewSetting;
     }
     set
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull(nameof(table));
         }
         value.SetDataViewManager(_dataViewManager);
         value.SetDataTable(table);
         _list[table] = value;
     }
 }
 public void CopyTo(DataViewSetting[] ar, int index)
 {
     IEnumerator enumerator = this.GetEnumerator();
     while (enumerator.MoveNext())
     {
         ar.SetValue(enumerator.Current, index++);
     }
 }
示例#6
0
 public DataView CreateDataView(DataTable table)
 {
     if (settings [table] != null)
     {
         DataViewSetting s = settings [table];
         return(new DataView(table, this, s.Sort, s.RowFilter, s.RowStateFilter));
     }
     else
     {
         return(new DataView(table));
     }
 }
 public virtual DataViewSetting this [string tableName] {
     get {
         for (int i = 0; i < settingList.Count; i++)
         {
             DataViewSetting dvs = (DataViewSetting)settingList [i];
             if (dvs.Table.TableName == tableName)
             {
                 return(dvs);
             }
         }
         return(null);
     }
 }
 public virtual DataViewSetting this [DataTable table] {
     get {
         for (int i = 0; i < settingList.Count; i++)
         {
             DataViewSetting dvs = (DataViewSetting)settingList [i];
             if (dvs.Table == table)
             {
                 return(dvs);
             }
         }
         return(null);
     }
     set {
         this [table] = value;
     }
 }
		public void CopyTo (DataViewSetting [] ar, int index)
		{
			settingList.CopyTo (ar, index);
		}
 public void CopyTo(DataViewSetting[] ar, int index) {
     System.Collections.IEnumerator Enumerator = GetEnumerator();
     while (Enumerator.MoveNext()) {
         ar.SetValue(Enumerator.Current, index++);
     }
 }
 public virtual DataViewSetting this[DataTable table]
 {
     get
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull("table");
         }
         DataViewSetting setting = (DataViewSetting) this.list[table];
         if (setting == null)
         {
             setting = new DataViewSetting();
             this[table] = setting;
         }
         return setting;
     }
     set
     {
         if (table == null)
         {
             throw ExceptionBuilder.ArgumentNull("table");
         }
         value.SetDataViewManager(this.dataViewManager);
         value.SetDataTable(table);
         this.list[table] = value;
     }
 }