Browse Source

Use readonly properties instead of public fields

pull/3782/head
Benedikt Schroeder 7 years ago
parent
commit
273d320212
  1. 8
      src/Avalonia.Visuals/Media/Fonts/FontKey.cs

8
src/Avalonia.Visuals/Media/Fonts/FontKey.cs

@ -4,10 +4,6 @@ namespace Avalonia.Media.Fonts
{ {
public readonly struct FontKey : IEquatable<FontKey> public readonly struct FontKey : IEquatable<FontKey>
{ {
public readonly string FamilyName;
public readonly FontStyle Style;
public readonly FontWeight Weight;
public FontKey(string familyName, FontWeight weight, FontStyle style) public FontKey(string familyName, FontWeight weight, FontStyle style)
{ {
FamilyName = familyName; FamilyName = familyName;
@ -15,6 +11,10 @@ namespace Avalonia.Media.Fonts
Weight = weight; Weight = weight;
} }
public string FamilyName { get; }
public FontStyle Style { get; }
public FontWeight Weight { get; }
public override int GetHashCode() public override int GetHashCode()
{ {
var hash = FamilyName.GetHashCode(); var hash = FamilyName.GetHashCode();

Loading…
Cancel
Save