-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathIcon.cs
More file actions
56 lines (42 loc) · 1.7 KB
/
Icon.cs
File metadata and controls
56 lines (42 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System.Text.Json.Serialization;
namespace GoogleMaterialDesignIconsGenerator.Model.Google;
public class Icon : IEquatable<Icon>
{
[JsonPropertyName("name")]
public string Name { get; init; } = string.Empty;
[JsonPropertyName("version")]
public int Version { get; init; }
[JsonPropertyName("popularity")]
public int Popularity { get; init; }
[JsonPropertyName("codepoint")]
public int Codepoint { get; init; }
[JsonPropertyName("unsupported_families")]
public IReadOnlyCollection<string> UnsupportedFamilies { get; init; } = [];
[JsonPropertyName("categories")]
public IReadOnlyCollection<string> Categories { get; init; } = [];
[JsonPropertyName("tags")]
public IReadOnlyCollection<string> Tags { get; init; } = [];
[JsonPropertyName("sizes_px")]
public IReadOnlyCollection<int> SizesPx { get; init; } = [];
public bool Equals(Icon? other)
{
if (ReferenceEquals(null, other))
{
return false;
}
if (ReferenceEquals(this, other))
{
return true;
}
return Name == other.Name
&& Version == other.Version
&& Popularity == other.Popularity
&& Codepoint == other.Codepoint
&& UnsupportedFamilies.Equals(other.UnsupportedFamilies)
&& Categories.Equals(other.Categories)
&& Tags.Equals(other.Tags)
&& SizesPx.Equals(other.SizesPx);
}
public override bool Equals(object? obj) => obj is Icon icon && Equals(icon);
public override int GetHashCode() => HashCode.Combine(Name, Version, Popularity, Codepoint, UnsupportedFamilies, Categories, Tags, SizesPx);
}