扩展多行代码片段会在底部添加额外的行

时间:2014-04-10 14:16:54

标签: vb.net visual-studio visual-studio-2010 code-snippets

有没有办法阻止在VB.NET中的多行代码段下添加额外的行?

enter image description here

(点击Tab键展开代码段...)

enter image description here

我已经仔细检查过片段本身最后没有额外的行。此外,这似乎是特定于VB的。

2 个答案:

答案 0 :(得分:0)

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>trycatchex</Title>
<Shortcut>trycatchex</Shortcut>
<Description>Code snippet for try catch</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
<SnippetType>SurroundsWith</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>expression</ID>
<ToolTip>Exception type</ToolTip>
<Function>SimpleTypeName(global::System.Exception)</Function>
</Literal>
</Declarations>
<Code Language="VB">
<![CDATA[Try
catch ex As Exception
End Try
End Sub]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

答案 1 :(得分:0)

剪断结束后关闭public class Rootobject { public Class1[] Property1 { get; set; } } public class Class1 { public int lat { get; set; } public int lon { get; set; } public DateTime date_iso { get; set; } public int date { get; set; } public float value { get; set; } } string json = @"[{""lat"":54,""lon"":9,""date_iso"":""2018 - 05 - 08T12: 00:00Z"",""date"":1525780800,""value"":5.62}]"; Class1[] result = JsonConvert.DeserializeObject<Class1[]>(json); 。插入剪切后,]]部分将插入符号设置在此位置。

¿end¿