Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
RequiredAttribute.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
class
RequiredAttribute
:
ValidationAttribute
5
{
6
public
bool
AllowEmptyStrings
{
get
;
set
; }
7
8
public
RequiredAttribute
()
9
: base(() =>
System
.
SR
.RequiredAttribute_ValidationError)
10
{
11
}
12
13
public
override
bool
IsValid
(
object
?
value
)
14
{
15
if
(
value
==
null
)
16
{
17
return
false
;
18
}
19
if
(!
AllowEmptyStrings
&&
value
is
string
value2)
20
{
21
return
!
string
.IsNullOrWhiteSpace(value2);
22
}
23
return
true
;
24
}
25
}
System.ComponentModel.DataAnnotations.RequiredAttribute.AllowEmptyStrings
bool AllowEmptyStrings
Definition
RequiredAttribute.cs:6
System.ComponentModel.DataAnnotations.RequiredAttribute.IsValid
override bool IsValid(object? value)
Definition
RequiredAttribute.cs:13
System.ComponentModel.DataAnnotations.RequiredAttribute.RequiredAttribute
RequiredAttribute()
Definition
RequiredAttribute.cs:8
System.ComponentModel.DataAnnotations.RequiredAttribute
Definition
RequiredAttribute.cs:5
System.ComponentModel.DataAnnotations.ValidationAttribute
Definition
ValidationAttribute.cs:8
System.SR
Definition
SR.cs:7
System.ComponentModel.DataAnnotations
Definition
ColumnAttribute.cs:3
System.ExceptionArgument.value
@ value
System.AttributeTargets
AttributeTargets
Definition
AttributeTargets.cs:5
System
Definition
BlockingCollection.cs:8
source
System.ComponentModel.Annotations
System.ComponentModel.DataAnnotations
RequiredAttribute.cs
Generated by
1.10.0