Color.Equals Метод
Определение
Перегрузки
Equals(Color) |
Указывает, равен ли текущий объект другому объекту того же типа.Indicates whether the current object is equal to another object of the same type. |
Equals(Object) |
Проверяет, является ли указанный объект структурой Color, эквивалентной структуре Color.Tests whether the specified object is a Color structure and is equivalent to this Color structure. |
Equals(Color)
Указывает, равен ли текущий объект другому объекту того же типа.Indicates whether the current object is equal to another object of the same type.
public:
virtual bool Equals(System::Drawing::Color other);
public bool Equals (System.Drawing.Color other);
override this.Equals : System.Drawing.Color -> bool
Public Function Equals (other As Color) As Boolean
Параметры
- other
- Color
Объект, который требуется сравнить с данным объектом.An object to compare with this object.
Возвращаемое значение
Значение true
, если текущий объект равен other
; в противном случае — значение false
.true
if the current object is equal to other
; otherwise, false
.
Реализации
Применяется к
Equals(Object)
public:
override bool Equals(System::Object ^ obj);
public override bool Equals (object? obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean
Параметры
- obj
- Object
Объект для тестирования.The object to test.
Возвращаемое значение
Значение true
, если obj
является структурой Color, эквивалентной структуре Color; в противном случае — значение false
.true
if obj
is a Color structure equivalent to this Color structure; otherwise, false
.
Комментарии
Эта структура выполняет только сравнения с другими Color структурами.This structure only does comparisons with other Color structures. Для сравнения цветов, основанных только на значениях ARGB, следует использовать ToArgb метод.To compare colors based solely on their ARGB values, you should use the ToArgb method. Это обусловлено тем, что Equals Equality члены и определяют эквивалентность, используя не только ARGB-значения цветов.This is because the Equals and Equality members determine equivalency using more than just the ARGB value of the colors. Например, Black и не FromArgb(0,0,0)
считаются равными, поскольку Black — это именованный цвет, а FromArgb(0,0,0)
не.For example, Black and FromArgb(0,0,0)
are not considered equal, since Black is a named color and FromArgb(0,0,0)
is not.