using System; using System.Collections.Generic; using System.Text; using System.Data; namespace sharpcomparer { public class Table { private string tableCatalog; private string tableSchema; private string tableName; private string tableType; private List columns; private List indexes; [Hide()] public string TableCatalog { get { return tableCatalog; } set { tableCatalog = value; } } public string TableSchema { get { return tableSchema; } set { tableSchema = value; } } public string TableName { get { return tableName; } set { tableName = value; } } public string TableType { get { return tableType; } set { tableType = value; } } [Hide()] public List Columns { get { return columns; } set { columns = value; } } [Hide()] public List Indexes { get { return indexes; } set { indexes = value; } } public Table(string tableCatalog, string tableSchema, string tableName, string tableType) { this.tableCatalog = tableCatalog; this.tableSchema = tableSchema; this.tableName = tableName; this.tableType = tableType; this.columns = new List(); this.indexes = new List(); } public static bool operator ==(Table a, Table b) { if (System.Object.ReferenceEquals(a, b)) { return true; } if (((object)a == null) || ((object)b == null)) { return false; } if ( !(a.tableSchema == b.tableSchema && a.tableName == b.tableName && a.tableType == b.tableType) ) { return false; } foreach (ColumnComparison comparison in ColumnComparison.Compare(a.Columns, b.Columns)) { if (comparison.Difference != ColumnComparison.ComparisonDifference.None) { return false; } } return true; } public static bool operator !=(Table a, Table b) { return !(a == b); } } }