Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EmailAddressAttribute.cs
Go to the documentation of this file.
2
3[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
5{
8 {
9 base.DefaultErrorMessage = System.SR.EmailAddressAttribute_Invalid;
10 }
11
12 public override bool IsValid(object? value)
13 {
14 if (value == null)
15 {
16 return true;
17 }
18 if (!(value is string text))
19 {
20 return false;
21 }
22 int num = text.IndexOf('@');
23 if (num > 0 && num != text.Length - 1)
24 {
25 return num == text.LastIndexOf('@');
26 }
27 return false;
28 }
29}
static string EmailAddressAttribute_Invalid
Definition SR.cs:48
Definition SR.cs:7