コード例 #1
0
        protected override T CreateObject <T>(Table table, Row row)
        {
            DynaType    dynaType = typeConverter.GetDynaType(table);
            DynaRow <T> bean     = dynaType.NewInstance <T>();

            SetProperties(table, row, table.Columns, bean);
            return(bean.Instance);
        }
コード例 #2
0
        private DataRow CreateDataRow(DataTable dataTable, Table table, Row row, DynaType dynaType)
        {
            DataRow dataRow = dataTable.NewRow();

            foreach (DataColumn column in dataTable.Columns)
            {
                string columnName = column.ColumnName;
                if (!ForSearchKey || searchKeyMap[columnName])
                {
                    string textValue = GetValue(row, columnName);
                    dataRow[column] = ToObject(dynaType[columnName], textValue, table, row);
                }
            }
            return(dataRow);
        }
コード例 #3
0
        protected virtual DataTable GetDataTable(string typeName)
        {
            Table     table     = GetTable(Section, typeof(DataTable), typeName);
            DataTable dataTable = CreateDataTable(table);
            DynaType  dynaType  = typeConverter.GetDynaType(table);

            List <Row> rows = table.Rows;

            foreach (Row row in rows)
            {
                DataRow dataRow = CreateDataRow(dataTable, table, row, dynaType);
                dataTable.Rows.Add(dataRow);
            }
            return(dataTable);
        }
コード例 #4
0
ファイル: TypeConverter.cs プロジェクト: kaakaa/FixtureBook
 public DynaRow(DynaType dynaType)
 {
     DynaType = dynaType;
     Instance = Activator.CreateInstance <T>();
 }