[]
Checks whether this font information is equal to another object.
Two FontInfo objects are considered equal when their Name,
Bold, and Italic properties have the same values. This method
returns false if obj is not a FontInfo instance or is
null.
public override bool Equals(object obj)
Public Overrides Function Equals(obj As Object) As Boolean
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with this font information. May be |
| Type | Description |
|---|---|
| bool |
true
if the specified object is a FontInfo with the same Name, Bold, and Italic values; otherwise, false.
|
FontInfo fontInfo = new FontInfo();
fontInfo.Name = "Arial";
fontInfo.Bold = true;
fontInfo.Italic = false;
FontInfo other = new FontInfo();
other.Name = "Arial";
other.Bold = true;
other.Italic = false;
bool isEqual = fontInfo.Equals(other);