Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
ThrowHelper.cs
Go to the documentation of this file.
2
3namespace System.Linq;
4
5internal static class ThrowHelper
6{
7 [DoesNotReturn]
8 internal static void ThrowArgumentNullException(ExceptionArgument argument)
9 {
10 throw new ArgumentNullException(GetArgumentString(argument));
11 }
12
13 [DoesNotReturn]
15 {
17 }
18
19 [DoesNotReturn]
24
25 [DoesNotReturn]
30
31 [DoesNotReturn]
32 internal static void ThrowNoElementsException()
33 {
35 }
36
37 [DoesNotReturn]
38 internal static void ThrowNoMatchException()
39 {
41 }
42
43 [DoesNotReturn]
44 internal static void ThrowNotSupportedException()
45 {
46 throw new NotSupportedException();
47 }
48
49 private static string GetArgumentString(ExceptionArgument argument)
50 {
51 return argument switch
52 {
53 ExceptionArgument.collectionSelector => "collectionSelector",
54 ExceptionArgument.count => "count",
55 ExceptionArgument.elementSelector => "elementSelector",
56 ExceptionArgument.enumerable => "enumerable",
57 ExceptionArgument.first => "first",
58 ExceptionArgument.func => "func",
59 ExceptionArgument.index => "index",
60 ExceptionArgument.inner => "inner",
61 ExceptionArgument.innerKeySelector => "innerKeySelector",
62 ExceptionArgument.keySelector => "keySelector",
63 ExceptionArgument.outer => "outer",
64 ExceptionArgument.outerKeySelector => "outerKeySelector",
65 ExceptionArgument.predicate => "predicate",
66 ExceptionArgument.resultSelector => "resultSelector",
67 ExceptionArgument.second => "second",
68 ExceptionArgument.selector => "selector",
69 ExceptionArgument.source => "source",
70 ExceptionArgument.third => "third",
71 ExceptionArgument.size => "size",
72 _ => string.Empty,
73 };
74 }
75}
static void ThrowNoElementsException()
static void ThrowMoreThanOneElementException()
static void ThrowArgumentOutOfRangeException(ExceptionArgument argument)
static string GetArgumentString(ExceptionArgument argument)
static void ThrowMoreThanOneMatchException()
static void ThrowArgumentNullException(ExceptionArgument argument)
Definition ThrowHelper.cs:8
static void ThrowNotSupportedException()
static void ThrowNoMatchException()
static string NoElements
Definition SR.cs:16
static string MoreThanOneMatch
Definition SR.cs:14
static string NoMatch
Definition SR.cs:22
static string MoreThanOneElement
Definition SR.cs:16
Definition SR.cs:7