mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-04 08:56:15 +02:00
33 lines
645 B
C#
33 lines
645 B
C#
using System.Collections.Generic;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Drawing;
|
|
|
|
namespace DesktopMagic.Api.Drawing;
|
|
|
|
internal class FontComparer : IEqualityComparer<Font>
|
|
{
|
|
public bool Equals(Font font1, Font font2)
|
|
{
|
|
if (font1.Name != font2.Name)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (font1.SizeInPoints != font2.SizeInPoints)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (font1.Style != font2.Style)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public int GetHashCode([DisallowNull] Font obj)
|
|
{
|
|
return obj.GetHashCode();
|
|
}
|
|
} |