private void DoAddTables() { AddTablesAndColumnsRequest.Raise(new AddTablesAndColumnsConfirmation(viewModel.DataViewModel) { Title = "Adding tables and columns..." }, (result) => { if (result != null && result.Confirmed && result.SelectedSprint != null && result.SelectedSprint.DbSchemaTables != null) { foreach (var t in result.SelectedSprint.DbSchemaTables) { if (t.IsChecked && t.IsVisible) { var newDBTable = new NodeDbTable(EventAggregator, this, viewModel) { Name = t.Name }; if (t.Columns != null) { newDBTable.Nodes = new ObservableCollection <NodeDbColumn>(); foreach (var c in t.Columns) { if (c.IsChecked && c.IsVisible) { var newCol = new NodeDbColumn(EventAggregator, newDBTable, viewModel) { Name = c.Name }; newDBTable.Nodes.Add(newCol); } } } this.Nodes.Add(newDBTable); } } } }); }
public NodeDbColumn(IEventAggregator eventAggregator, NodeDbTable dbTable, MainViewModel viewModel) : base(eventAggregator) { this.viewModel = viewModel; NodeDbTable = dbTable; }
public NodeDbColumn(IEventAggregator eventAggregator, NodeDbTable dbTable) : base(eventAggregator) { NodeDbTable = dbTable; }