Terraria
v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ExceptionHandler.cs
Go to the documentation of this file.
1
using
System.Globalization
;
2
using
System.Runtime.CompilerServices
;
3
4
namespace
System.Linq.Expressions.Interpreter
;
5
6
internal
sealed
class
ExceptionHandler
7
{
8
private
readonly
Type
_exceptionType
;
9
10
public
readonly
int
LabelIndex
;
11
12
public
readonly
int
HandlerStartIndex
;
13
14
public
readonly
int
HandlerEndIndex
;
15
16
public
readonly
ExceptionFilter
Filter
;
17
18
internal
ExceptionHandler
(
int
labelIndex,
int
handlerStartIndex,
int
handlerEndIndex,
Type
exceptionType,
ExceptionFilter
filter)
19
{
20
LabelIndex
= labelIndex;
21
_exceptionType
= exceptionType;
22
HandlerStartIndex
= handlerStartIndex;
23
HandlerEndIndex
= handlerEndIndex;
24
Filter
= filter;
25
}
26
27
public
bool
Matches
(
Type
exceptionType)
28
{
29
return
_exceptionType
.
IsAssignableFrom
(exceptionType);
30
}
31
32
public
override
string
ToString
()
33
{
34
IFormatProvider
invariantCulture =
CultureInfo
.
InvariantCulture
;
35
DefaultInterpolatedStringHandler
handler =
new
DefaultInterpolatedStringHandler
(13, 3, invariantCulture);
36
handler.
AppendLiteral
(
"catch ("
);
37
handler.
AppendFormatted
(
_exceptionType
.
Name
);
38
handler.
AppendLiteral
(
") ["
);
39
handler.
AppendFormatted
(
HandlerStartIndex
);
40
handler.
AppendLiteral
(
"->"
);
41
handler.
AppendFormatted
(
HandlerEndIndex
);
42
handler.
AppendLiteral
(
"]"
);
43
return
string
.Create(invariantCulture, ref handler);
44
}
45
}
System.Globalization.CultureInfo.InvariantCulture
static CultureInfo InvariantCulture
Definition
CultureInfo.cs:144
System.Globalization.CultureInfo
Definition
CultureInfo.cs:8
System.Linq.Expressions.Interpreter.ExceptionFilter
Definition
ExceptionFilter.cs:4
System.Linq.Expressions.Interpreter.ExceptionHandler.LabelIndex
readonly int LabelIndex
Definition
ExceptionHandler.cs:10
System.Linq.Expressions.Interpreter.ExceptionHandler.Filter
readonly ExceptionFilter Filter
Definition
ExceptionHandler.cs:16
System.Linq.Expressions.Interpreter.ExceptionHandler.HandlerEndIndex
readonly int HandlerEndIndex
Definition
ExceptionHandler.cs:14
System.Linq.Expressions.Interpreter.ExceptionHandler._exceptionType
readonly Type _exceptionType
Definition
ExceptionHandler.cs:8
System.Linq.Expressions.Interpreter.ExceptionHandler.Matches
bool Matches(Type exceptionType)
Definition
ExceptionHandler.cs:27
System.Linq.Expressions.Interpreter.ExceptionHandler.HandlerStartIndex
readonly int HandlerStartIndex
Definition
ExceptionHandler.cs:12
System.Linq.Expressions.Interpreter.ExceptionHandler.ToString
override string ToString()
Definition
ExceptionHandler.cs:32
System.Linq.Expressions.Interpreter.ExceptionHandler.ExceptionHandler
ExceptionHandler(int labelIndex, int handlerStartIndex, int handlerEndIndex, Type exceptionType, ExceptionFilter filter)
Definition
ExceptionHandler.cs:18
System.Linq.Expressions.Interpreter.ExceptionHandler
Definition
ExceptionHandler.cs:7
System.Reflection.MemberInfo.Name
string Name
Definition
MemberInfo.cs:10
System.Type.IsAssignableFrom
virtual bool IsAssignableFrom([NotNullWhen(true)] Type? c)
Definition
Type.cs:1561
System.Type
Definition
Type.cs:14
System.IFormatProvider
Definition
IFormatProvider.cs:4
System.Globalization
Definition
Calendar.cs:1
System.Linq.Expressions.Interpreter
Definition
ActionCallInstruction.cs:3
System.Runtime.CompilerServices
Definition
NullablePublicOnlyAttribute.cs:3
System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendLiteral
void AppendLiteral(string value)
Definition
DefaultInterpolatedStringHandler.cs:78
System.Runtime.CompilerServices.DefaultInterpolatedStringHandler.AppendFormatted
void AppendFormatted(ReadOnlySpan< char > value)
Definition
DefaultInterpolatedStringHandler.cs:210
System.Runtime.CompilerServices.DefaultInterpolatedStringHandler
Definition
DefaultInterpolatedStringHandler.cs:10
source
System.Linq.Expressions
System.Linq.Expressions.Interpreter
ExceptionHandler.cs
Generated by
1.10.0