Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ProvidePropertyAttribute.cs
Go to the documentation of this file.
2
4
5[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
7{
8 public string PropertyName { get; }
9
10 [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)]
11 public string ReceiverTypeName { get; }
12
13 public override object TypeId => GetType().FullName + PropertyName;
14
15 public ProvidePropertyAttribute(string propertyName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type receiverType)
16 {
17 if (receiverType == null)
18 {
19 throw new ArgumentNullException("receiverType");
20 }
21 PropertyName = propertyName;
23 }
24
25 public ProvidePropertyAttribute(string propertyName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string receiverTypeName)
26 {
27 PropertyName = propertyName;
28 ReceiverTypeName = receiverTypeName;
29 }
30
31 public override bool Equals([NotNullWhen(true)] object? obj)
32 {
33 if (obj == this)
34 {
35 return true;
36 }
37 if (obj is ProvidePropertyAttribute providePropertyAttribute && providePropertyAttribute.PropertyName == PropertyName)
38 {
39 return providePropertyAttribute.ReceiverTypeName == ReceiverTypeName;
40 }
41 return false;
42 }
43
44 public override int GetHashCode()
45 {
46 return HashCode.Combine(PropertyName, ReceiverTypeName);
47 }
48}
ProvidePropertyAttribute(string propertyName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] string receiverTypeName)
override bool Equals([NotNullWhen(true)] object? obj)
ProvidePropertyAttribute(string propertyName, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicParameterlessConstructor)] Type receiverType)
string? AssemblyQualifiedName
Definition Type.cs:45