Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
EmailAddressAttribute.cs
Go to the documentation of this file.
1
namespace
System.ComponentModel.DataAnnotations
;
2
3
[AttributeUsage(
AttributeTargets
.Property |
AttributeTargets
.Field |
AttributeTargets
.Parameter, AllowMultiple =
false
)]
4
public
sealed
class
EmailAddressAttribute
:
DataTypeAttribute
5
{
6
public
EmailAddressAttribute
()
7
: base(
DataType
.
EmailAddress
)
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
}
System.ComponentModel.DataAnnotations.DataTypeAttribute
Definition
DataTypeAttribute.cs:5
System.ComponentModel.DataAnnotations.EmailAddressAttribute.EmailAddressAttribute
EmailAddressAttribute()
Definition
EmailAddressAttribute.cs:6
System.ComponentModel.DataAnnotations.EmailAddressAttribute.IsValid
override bool IsValid(object? value)
Definition
EmailAddressAttribute.cs:12
System.ComponentModel.DataAnnotations.EmailAddressAttribute
Definition
EmailAddressAttribute.cs:5
System.SR.EmailAddressAttribute_Invalid
static string EmailAddressAttribute_Invalid
Definition
SR.cs:48
System.SR
Definition
SR.cs:7
System.ComponentModel.DataAnnotations.DataType
DataType
Definition
DataType.cs:4
System.ComponentModel.DataAnnotations.DataType.EmailAddress
@ EmailAddress
System.ComponentModel.DataAnnotations
Definition
ColumnAttribute.cs:3
System.ExceptionArgument.text
@ text
System.ExceptionArgument.value
@ value
System.AttributeTargets
AttributeTargets
Definition
AttributeTargets.cs:5
System
Definition
BlockingCollection.cs:8
source
System.ComponentModel.Annotations
System.ComponentModel.DataAnnotations
EmailAddressAttribute.cs
Generated by
1.10.0