-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenuma.snippet
More file actions
41 lines (38 loc) · 1.26 KB
/
enuma.snippet
File metadata and controls
41 lines (38 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Null Argument Exception</Title>
<Shortcut>enuma</Shortcut>
<Description>Code snippet for Enum Out-of-Range Exception</Description>
<Author>Jordan S. Munroe</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>arg_name</ID>
<ToolTip>Argument name.</ToolTip>
<Default>arg_name</Default>
</Literal>
<Literal>
<ID>type_name</ID>
<ToolTip>Type of enum.</ToolTip>
<Default>type_name</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[ #region Argument Validation
if (!Enum.IsDefined(typeof($type_name$), $arg_name$))
{
throw new ArgumentOutOfRangeException("$arg_name$");
}
/// <exception cref="ArgumentOutOfRangeException">Thrown if <paramref name="$arg_name$"/> is not a defined value of "$type_name$".</exception>
#endregion
$end$]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>