public override int GetHashCode() { unchecked { int result = Location.GetHashCode(); result = (result * 397) ^ Value.GetHashCode(); result = (result * 397) ^ IsWrite.GetHashCode(); return(result); } }
/// <summary> /// Returns a hash code for this instance. /// </summary> /// <returns>A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.</returns> public override int GetHashCode() { unchecked { var hashCode = Address.GetHashCode(); hashCode = (hashCode * 397) ^ Length.GetHashCode(); hashCode = (hashCode * 397) ^ IsRead.GetHashCode(); hashCode = (hashCode * 397) ^ IsWrite.GetHashCode(); return(hashCode); } }
public OpenConnection(IsWrite isWrite,OleDbConnection connectionIn) { if (isWriteProceeding) throw new Exception("BUG: Trying to open connection while writing"); lockFile = null; connection = null; wasConnectionOpen= (connectionIn.State == ConnectionState.Open); if (!wasConnectionOpen) { if (isWrite == IsWrite.Yes) { lockFile = DataInterface.CreateLockFile("database"); } else { lockFile = DataInterface.CreateSharedLockFile("database"); } connectionIn.Open(); connection = connectionIn; } isWriteProceeding = (isWrite == IsWrite.Yes); }