Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ThrowHelper.cs
Go to the documentation of this file.
2
4
5internal static class ThrowHelper
6{
7 [DoesNotReturn]
9 {
11 }
12
13 [DoesNotReturn]
18
19 [DoesNotReturn]
24
25 [DoesNotReturn]
30
31 [DoesNotReturn]
32 internal static void ThrowNotSupportedException(ExceptionResource resource)
33 {
35 }
36
38 {
39 return arg switch
40 {
41 ExceptionArgument.assemblyname => "assemblyname",
42 ExceptionArgument.array => "array",
43 ExceptionArgument.arrayIndex => "arrayIndex",
44 ExceptionArgument.count => "count",
45 ExceptionArgument.evaluator => "evaluator",
46 ExceptionArgument.i => "i",
47 ExceptionArgument.inner => "inner",
48 ExceptionArgument.input => "input",
49 ExceptionArgument.length => "length",
50 ExceptionArgument.matchTimeout => "matchTimeout",
51 ExceptionArgument.name => "name",
52 ExceptionArgument.options => "options",
53 ExceptionArgument.pattern => "pattern",
54 ExceptionArgument.regexinfos => "regexinfos",
55 ExceptionArgument.replacement => "replacement",
56 ExceptionArgument.startat => "startat",
57 ExceptionArgument.str => "str",
58 ExceptionArgument.value => "value",
59 _ => null,
60 };
61 }
62
63 private static string GetStringForExceptionResource(ExceptionResource resource)
64 {
65 return resource switch
66 {
67 ExceptionResource.BeginIndexNotNegative => System.SR.BeginIndexNotNegative,
68 ExceptionResource.CountTooSmall => System.SR.CountTooSmall,
69 ExceptionResource.LengthNotNegative => System.SR.LengthNotNegative,
70 ExceptionResource.OnlyAllowedOnce => System.SR.OnlyAllowedOnce,
71 ExceptionResource.ReplacementError => System.SR.ReplacementError,
72 _ => null,
73 };
74 }
75}
static string ReplacementError
Definition SR.cs:76
static string BeginIndexNotNegative
Definition SR.cs:22
static string LengthNotNegative
Definition SR.cs:48
static string CountTooSmall
Definition SR.cs:28
static string OnlyAllowedOnce
Definition SR.cs:68
Definition SR.cs:7
static void ThrowNotSupportedException(ExceptionResource resource)
static string GetStringForExceptionArgument(ExceptionArgument arg)
static void ThrowArgumentNullException(ExceptionArgument arg)
static Exception CreateArgumentException(ExceptionResource resource)
Definition ThrowHelper.cs:8
static void ThrowArgumentOutOfRangeException(ExceptionArgument arg, ExceptionResource resource)
static void ThrowArgumentOutOfRangeException(ExceptionArgument arg)
static string GetStringForExceptionResource(ExceptionResource resource)