示例#1
0
 ///一个表格初始化完成
 static private void onTableInit(TableBase table)
 {
     table.OnInit -= onTableInit;
     flag++;
     if (OnInitTable != null)
     {
         OnInitTable(table.GetType().ToString(), flag, tableList.Count);
     }
     initNextTable();
 }
示例#2
0
 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>());
 }
示例#3
0
 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]);
 }
示例#4
0
        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));
            }
        }