public Table(TableNode node, DataRow row, DataTable columns) { _owningNode = node; IsNew = row == null; Columns = new TablePartCollection <Column>(); Indexes = new TablePartCollection <Index>(); ForeignKeys = new TablePartCollection <ForeignKey>(); // set some defaults that may be overridden with actual table data Engine = node.DefaultStorageEngine; PackKeys = PackKeysMethod.Default; Schema = node.Database; if (row != null) { ParseTableData(row); } if (columns != null) { ParseColumns(columns); } if (!IsNew) { LoadIndexes(); LoadForeignKeys(); } // now save our current values as old OldTable = new Table(); ObjectHelper.Copy(this, OldTable); node.DataSaved += node_DataSaved; }
void node_DataSaved(object sender, EventArgs e) { ObjectHelper.Copy(this, OldTable); Columns.Saved(); Indexes.Saved(); ForeignKeys.Saved(); }
public Column(DataRow row) : this() { isNew = row == null; if (row != null) { ParseColumnInfo(row); } OldColumn = new Column(); ObjectHelper.Copy(this, OldColumn); }
void ITablePart.Saved() { ObjectHelper.Copy(this, OldColumn); }