Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
DesignerCategoryAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)]
7{
8 public static readonly DesignerCategoryAttribute Component = new DesignerCategoryAttribute("Component");
9
11
12 public static readonly DesignerCategoryAttribute Form = new DesignerCategoryAttribute("Form");
13
14 public static readonly DesignerCategoryAttribute Generic = new DesignerCategoryAttribute("Designer");
15
16 public string Category { get; }
17
18 public override object TypeId => GetType().FullName + Category;
19
21 : this(string.Empty)
22 {
23 }
24
25 public DesignerCategoryAttribute(string category)
26 {
27 Category = category;
28 }
29
30 public override bool Equals([NotNullWhen(true)] object? obj)
31 {
32 if (obj is DesignerCategoryAttribute designerCategoryAttribute)
33 {
34 return designerCategoryAttribute.Category == Category;
35 }
36 return false;
37 }
38
39 public override int GetHashCode()
40 {
41 return Category?.GetHashCode() ?? 0;
42 }
43
44 public override bool IsDefaultAttribute()
45 {
46 return Category == Default.Category;
47 }
48}
static readonly DesignerCategoryAttribute Default
override bool Equals([NotNullWhen(true)] object? obj)
static readonly DesignerCategoryAttribute Form