///一个表格初始化完成 static private void onTableInit(TableBase table) { table.OnInit -= onTableInit; flag++; if (OnInitTable != null) { OnInitTable(table.GetType().ToString(), flag, tableList.Count); } initNextTable(); }
public IQueryable <Record> GetRows(TableBase table) { if (this.mTableRows.Count <= 0) { return(default(IQueryable <Record>)); } if (!this.mTableRows.ContainsKey(table)) { throw new Exception("Table instance of type '" + table.GetType() + "' does not exist in result. Check that is was included in select portion of query"); } return(mTableRows[table].AsQueryable <Record>()); }
public Record GetRow(TableBase table, int pIndex) { if (table == null) { throw new NullReferenceException("table cannot be null"); } if (pIndex < 0) { throw new IndexOutOfRangeException("pIndex must >= 0. pIndex == " + pIndex.ToString()); } if (!this.mTableRows.ContainsKey(table)) { throw new Exception("Table instance of type '" + table.GetType() + "' does not exist in result. Check that is was included in select portion of query"); } return(this.mTableRows[table][pIndex]); }
public override void ApplyToSheet(ExcelWorksheet sheet, RangeInfo range, object value) { TableBase table = value as TableBase; var props = table.GetType().GetProperties(); foreach (var prop in props) { if (prop.Name.Contains("TypeId"))//default property of Attribute object { continue; } var propAttributes = GetPropertyAttributes(prop); object propValue = prop.GetValue(value); propAttributes.ForEach(x => x.ApplyToSheet(sheet, null, propValue)); } }