Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
BooleanSwitch.cs
Go to the documentation of this file.
1
namespace
System.Diagnostics
;
2
3
[SwitchLevel(typeof(
bool
))]
4
public
class
BooleanSwitch
:
Switch
5
{
6
public
bool
Enabled
7
{
8
get
9
{
10
if
(base.SwitchSetting != 0)
11
{
12
return
true
;
13
}
14
return
false
;
15
}
16
set
17
{
18
base.SwitchSetting = (
value
? 1 : 0);
19
}
20
}
21
22
public
BooleanSwitch
(
string
displayName,
string
? description)
23
: base(displayName, description)
24
{
25
}
26
27
public
BooleanSwitch
(
string
displayName,
string
? description,
string
defaultSwitchValue)
28
: base(displayName, description, defaultSwitchValue)
29
{
30
}
31
32
protected
override
void
OnValueChanged
()
33
{
34
if
(
bool
.TryParse(base.Value, out var result))
35
{
36
base.SwitchSetting = (result ? 1 : 0);
37
}
38
else
39
{
40
base.OnValueChanged();
41
}
42
}
43
}
System.Diagnostics.BooleanSwitch.OnValueChanged
override void OnValueChanged()
Definition
BooleanSwitch.cs:32
System.Diagnostics.BooleanSwitch.BooleanSwitch
BooleanSwitch(string displayName, string? description, string defaultSwitchValue)
Definition
BooleanSwitch.cs:27
System.Diagnostics.BooleanSwitch.Enabled
bool Enabled
Definition
BooleanSwitch.cs:7
System.Diagnostics.BooleanSwitch.BooleanSwitch
BooleanSwitch(string displayName, string? description)
Definition
BooleanSwitch.cs:22
System.Diagnostics.BooleanSwitch
Definition
BooleanSwitch.cs:5
System.Diagnostics.Switch
Definition
Switch.cs:9
System.Diagnostics
Definition
AggregationManager.cs:6
System.ExceptionArgument.value
@ value
source
System.Diagnostics.TraceSource
System.Diagnostics
BooleanSwitch.cs
Generated by
1.10.0