public TableModel() { rows = new List <RowModel>(); filteredRows = new List <RowModel>(); columns = new List <ColumnModel>(); filters = new List <FilterStruct>(); sorts = new List <SortStruct>(); controller = new TableController(this); sortController = new SortController(this); filterController = new FilterController(this); columnListener = new ColumnChangeListener(this); rowListener = new RowChangeListener(this); nameListener = new NameChangeListener(this); rowDataListener = new RowDataListener(this); }
public void SetTable(DatabaseReference table, DatabaseReference tableName) { consume_name_update = false; if (databaseTable != null) { UnbindListeners(); } databaseTable = table; tableNameData = tableName; this.name = "somename"; columnListener = new ColumnChangeListener(this); rowListener = new RowChangeListener(this); nameListener = new NameChangeListener(this); rowDataListener = new RowDataListener(this); columns.Clear(); foreach (RowModel model in rows) { model.UnbindListeners(); } rows.Clear(); controller.NotifyViewCleared(); tableNameData.AddValueEventListener(nameListener); tableRowData = databaseTable.Child("row_data").Child("new_row_id"); tableRowData.AddValueEventListener(rowDataListener); //load columns databaseColumns = databaseTable.Child("columns"); databaseColumns.AddChildEventListener(columnListener); //load rows databaseRows = databaseTable.Child("rows"); databaseRows.AddChildEventListener(rowListener); }
public ItemEditActivity() { columnListener = new ColumnChangeListener(this); columns = new List <ColumnModel>(); colorListener = new ColorListener(this); }