コード例 #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
ファイル: Table.cs プロジェクト: gronderc/ExcelReportEngine
        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));
            }
        }