Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ IsValid() [1/2]

override bool System.ComponentModel.DataAnnotations.EmailAddressAttribute.IsValid ( object? value)
inlinevirtual

Reimplemented from System.ComponentModel.DataAnnotations.DataTypeAttribute.

Definition at line 12 of file EmailAddressAttribute.cs.

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 }

References System.text, and System.value.