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

◆ IsValid() [1/2]

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

Reimplemented from System.ComponentModel.DataAnnotations.DataTypeAttribute.

Definition at line 12 of file UrlAttribute.cs.

13 {
14 if (value == null)
15 {
16 return true;
17 }
18 if (value is string text)
19 {
20 if (!text.StartsWith("http://", StringComparison.OrdinalIgnoreCase) && !text.StartsWith("https://", StringComparison.OrdinalIgnoreCase))
21 {
22 return text.StartsWith("ftp://", StringComparison.OrdinalIgnoreCase);
23 }
24 return true;
25 }
26 return false;
27 }

References System.text, and System.value.