-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathGetParameterValueAsElementId.snippet
37 lines (33 loc) · 1.38 KB
/
GetParameterValueAsElementId.snippet
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
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Get Parameter Value As Element Id</Title>
<Author>Maycon Freitas</Author>
<Description>Gets a parameter value as an ElementId.</Description>
<Shortcut>rvtgetparamelmid</Shortcut>
</Header>
<Snippet>
<Code Language="CSharp">
<![CDATA[ElementId $paramValue$ = $element$?.LookupParameter("$ParameterName$")?.AsElementId() ?? ElementId.InvalidElementId;]]>
</Code>
<Declarations>
<Literal>
<ID>paramValue</ID>
<Default>paramValue</Default>
<ToolTip>The name of the varible to receive the string value of the parameter.</ToolTip>
</Literal>
<Literal>
<ID>element</ID>
<Default>element</Default>
<ToolTip>The element to look for the parameter.</ToolTip>
</Literal>
<Literal>
<ID>ParameterName</ID>
<Default>Parameter Name</Default>
<ToolTip>The name of the parameter.</ToolTip>
</Literal>
</Declarations>
</Snippet>
</CodeSnippet>
</CodeSnippets>