ImageMagick.MagickGeometry.Equals C# (CSharp) Метод

Equals() публичный Метод

Determines whether the specified MagickGeometry is equal to the current MagickGeometry.
public Equals ( MagickGeometry other ) : bool
other MagickGeometry The to compare this with.
Результат bool
    public bool Equals(MagickGeometry other)
    {
      if (ReferenceEquals(other, null))
        return false;

      if (ReferenceEquals(this, other))
        return true;

      return
        Width == other.Width &&
        Height == other.Height &&
        X == other.X &&
        Y == other.Y &&
        IsPercentage == other.IsPercentage &&
        IgnoreAspectRatio == other.IgnoreAspectRatio &&
        Less == other.Less &&
        Greater == other.Greater &&
        FillArea == other.FillArea &&
        LimitPixels == other.LimitPixels;
    }

Same methods

MagickGeometry::Equals ( object obj ) : bool

Usage Example

Пример #1
0
    public void Test_IEquatable()
    {
      MagickGeometry first = new MagickGeometry(10, 5);

      Assert.IsFalse(first == null);
      Assert.IsFalse(first.Equals(null));
      Assert.IsTrue(first.Equals(first));
      Assert.IsTrue(first.Equals((object)first));

      MagickGeometry second = new MagickGeometry(10, 5);

      Assert.IsTrue(first == second);
      Assert.IsTrue(first.Equals(second));
      Assert.IsTrue(first.Equals((object)second));

      second = new MagickGeometry(5, 5);

      Assert.IsTrue(first != second);
      Assert.IsFalse(first.Equals(second));
    }