Ejemplo n.º 1
0
 /// <summary>
 /// Tests whether two specified <see cref="MemoryArray&lt;T&gt;"/> structures are equivalent.
 /// </summary>
 /// <param name="left">The <see cref="MemoryArray&lt;T&gt;"/> that is to the left of the equality operator.</param>
 /// <param name="right">The <see cref="MemoryArray&lt;T&gt;"/> that is to the right of the equality operator.</param>
 /// <returns>
 /// <b>true</b> if the two <see cref="MemoryArray&lt;T&gt;"/> structures are equal; otherwise, <b>false</b>.
 /// </returns>
 public static bool operator ==(MemoryArray <T> left, MemoryArray <T> right)
 {
     if (object.ReferenceEquals(left, right))
     {
         return(true);
     }
     if (object.ReferenceEquals(right, null) ||
         object.ReferenceEquals(left, null) ||
         (left.length != right.length))
     {
         return(false);
     }
     if (left.baseAddress == right.baseAddress)
     {
         return(true);
     }
     return(FreeImage.CompareMemory(left.baseAddress, right.baseAddress, (uint)left.length));
 }