Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int result = Location.GetHashCode();
         result = (result * 397) ^ Value.GetHashCode();
         result = (result * 397) ^ IsWrite.GetHashCode();
         return(result);
     }
 }
Ejemplo n.º 2
0
 /// <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);
     }
 }
Ejemplo n.º 3
0
 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);
 }