2
我创建了以下简单摘录Visual Studio代码片段重构
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets
xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Observable Property</Title>
<Description>Generates an Observable property based on type and Name</Description>
<Shortcut>nosp</Shortcut>
</Header>
<Snippet>
<Declarations>
<Literal>
<ID>PropertyName</ID>
<ToolTip>Defines the Property Name</ToolTip>
<Default>Name</Default>
</Literal>
<Literal>
<ID>PropertyType</ID>
<Type>Type</Type>
<ToolTip>Defines the Property Type</ToolTip>
<Default>String</Default>
</Literal>
</Declarations>
<Code Language="csharp">
<![CDATA[
public $PropertyType$ $PropertyName$
{
get { return Get<$PropertyType$>("$PropertyName$"); }
set
{
Set("$PropertyName$", value);
}
}
]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
及其工作像预期的那样创造例如
public VirtualKeyCode Key
{
get { return Get<VirtualKeyCode>("Key"); }
set
{
Set("Key", value);
}
}
是否有可能改变这一切$属性类型$位置时的一个例如在重构期间,它们在初始插入代码片段后发生了变化?