private void MenuColumnUsage_Clicked(object sender, RoutedEventArgs e) { try { if (this.SelectedColumn == null) { MessageBox.Show("Invalid Column Selection"); return; } ReverseEngineer reverse = new ReverseEngineer(this.Dispatcher); Connections.Instance.SetConnection((MenuItem)sender, false); string column = this.SelectedColumn.ColumnName; BrowseData browse = new BrowseData(SQLQueries.DatabaseQueries.DatabaseColumnUsageQuery(column), $"Column Usage for: {column}"); browse.Show(); } catch (Exception err) { MessageBox.Show(err.InnerExceptionMessage()); } }
public async void CreateTableObject(TableModel table) { if (!table.IsNewTable && (table.Columns == null || table.Columns.Count() == 0)) { await Task.Factory.StartNew(() => { ReverseEngineer reverseEngineer = new ReverseEngineer(this.Dispatcher); EventParser.ParseMessage(this, this.Dispatcher, string.Empty, "Reading table information."); table.Columns = table.Columns.AddRange(reverseEngineer.GetTableColumns(table.TableName).ToArray()); table.PrimaryKeyClusterConstraintName = reverseEngineer.GetTablePrimaryKeyCluster(table.TableName); }); } table.IsNewTable = false; table.IsDeleted = false; Integrity.MapTable(table); TableObject tableControl = new TableObject(table); tableControl.TableMove += this.TableObject_Move; tableControl.RemoveTable += this.TableObject_Remove; tableControl.ForeignKeyColumnAdded += this.TableObject_ForeignKeyAdded; foreach (KeyValuePair <string, DatabaseRelation> relation in tableControl.ColumnRelationModel) { relation.Value.DatabaseRelationDelete += this.DatabaseRelation_Delete; this.columnRelationModel.Add(relation.Key, relation.Value); } this.Children.Add(tableControl); this.ResizeCanvas(tableControl.Location, tableControl.ActualHeight, tableControl.ActualWidth); if (this.IsLoaded) { tableControl.InvalidateVisual(); this.AddRelationsDrawing(tableControl); } tableControl.TableColumnChanged += this.TableColumn_Changed; tableControl.TableHeaderChanged += this.TableHeader_Changed; }
public List <CompareResultModel> RunComparison(List <TableModel> tablesList) { this.canvasTables = tablesList; this.reverse = new ReverseEngineer(this.dispatcher); this.databaseTables = reverse.GetTables(); this.CheckTables(); this.CheckColumns(); this.CheckRelations(); return(this.result); }