예제 #1
0
 private TableColumn(TableTemplateBase template, DataTable table)
     : base(template.Domain, table)
 {
     this.template = template;
 }
예제 #2
0
        public static async Task <TableColumn> CreateAsync(Authentication authentication, TableTemplateBase template, DataTable table)
        {
            var domain = template.Domain;
            var tuple  = await domain.DataDispatcher.InvokeAsync(() =>
            {
                var column = new TableColumn(template, table);
                var query  = from DataRow item in table.Rows
                             where (item.RowState == DataRowState.Deleted || item.RowState == DataRowState.Detached) == false
                             select item.Field <string>(CremaSchema.ColumnName);

                var newName = NameUtility.GenerateNewName("Column", query);
                return(column, newName);
            });

            await tuple.column.SetFieldAsync(authentication, CremaSchema.ColumnName, tuple.newName);

            return(tuple.column);
        }
예제 #3
0
 public TableColumn(TableTemplateBase template, DataRow row)
     : base(template.Domain, row)
 {
     this.template = template;
 }