using System; using System.Collections.Generic; using System.Text; namespace sharpcomparer { public class ViewColumn : Column, IComparable { private string viewCatalog; private string viewSchema; private string viewName; private string tableCatalog; private string tableSchema; private string tableName; private string columnName; public string ViewCatalog { get { return viewCatalog; } set { viewCatalog = value; } } public string ViewSchema { get { return viewSchema; } set { viewSchema = value; } } public string ViewName { get { return viewName; } set { viewName = value; } } public ViewColumn( string viewCatalog, string viewSchema, string viewName, string tableCatalog, string tableSchema, string tableName, string columnName, int ordinalPosition, string columnDefault, bool isNullable, string dataType, int characterMaximumLength, int characterOctetLength, byte numericPrecision, short numericPrecisionRadix, int numericScale, short datetimePrecision, string characterSetCatalog, string characterSetSchema, string characterSetName, string collationCatalog) : base( tableCatalog, tableSchema, tableName, columnName, ordinalPosition, columnDefault, isNullable, dataType, characterMaximumLength, characterOctetLength, numericPrecision, numericPrecisionRadix, numericScale, datetimePrecision, characterSetCatalog, characterSetSchema, characterSetName, collationCatalog) { this.viewCatalog = viewCatalog; this.viewSchema = viewSchema; this.viewName = viewName; this.tableCatalog = tableCatalog; this.tableSchema = tableSchema; this.tableName = tableName; this.columnName = columnName; } public static bool operator ==(ViewColumn a, ViewColumn b) { if (System.Object.ReferenceEquals(a, b)) { return true; } if (((object)a == null) || ((object)b == null)) { return false; } return a.tableCatalog == b.tableCatalog && a.tableSchema == b.TableSchema && a.tableName == b.TableName && a.columnName == b.ColumnName; } public static bool operator !=(ViewColumn a, ViewColumn b) { return !(a == b); } public override int GetHashCode() { return base.GetHashCode(); } #region IComparable Members public int CompareTo(ViewColumn other) { int comparison = columnName.CompareTo(other.ColumnName); if (comparison == 0) { comparison = TableName.CompareTo(other.TableName); } return comparison; } #endregion } }