AlessandroDelSole / CodeSnippetStudio2022

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Issues with the replacements

FrancisDOSSANTOS opened this issue · comments

There are issues with the replacements management.
If I open the propdp.snippet and save it, there are issues with the replacements in the code section.
All the "$" are duplicated and the word "typeof" is replaced by "$type$of"

Here is the Original file

<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets  xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Define a DependencyProperty</Title>
            <Shortcut>propdp</Shortcut>
            <Description>Code snippet for a property using DependencyProperty as the backing store</Description>
            <Author>Microsoft Corporation</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>type</ID>
                    <ToolTip>Property Type</ToolTip>
                    <Default>int</Default>
                </Literal>
                <Literal>
                    <ID>property</ID>
                    <ToolTip>Property Name</ToolTip>
                    <Default>MyProperty</Default>
                </Literal>
                <Literal>
                    <ID>ownerclass</ID>
                    <ToolTip>The owning class of this Property.  Typically the class that it is declared in.</ToolTip>
                    <Default>ownerclass</Default>
                </Literal>
                <Literal>
                    <ID>defaultvalue</ID>
                    <ToolTip>The default value for this property.</ToolTip>
                    <Default>0</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[

public $type$ $property$
{
    get { return ($type$)GetValue($property$Property); }
    set { SetValue($property$Property, value); }
}

// Using a DependencyProperty as the backing store for $property$.  This enables animation, styling, binding, etc...
public static readonly DependencyProperty $property$Property = 
    DependencyProperty.Register("$property$", typeof($type$), typeof($ownerclass$), new PropertyMetadata($defaultvalue$));

$end$]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>

Here is the saved file

<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Define a DependencyProperty</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Code snippet for a property using DependencyProperty as the backing store</Description>
      <HelpUrl></HelpUrl>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Keywords>
        <Keyword></Keyword>
        <Keyword></Keyword>
      </Keywords>
      <Shortcut>fdspropdp</Shortcut>
    </Header>
    <Snippet>
      <References />
      <Imports />
      <Declarations>
        <Literal Editable="true">
          <ID>type</ID>
          <ToolTip>Property Type</ToolTip>
          <Default>int</Default>
          <Function></Function>
        </Literal>
        <Literal Editable="true">
          <ID>property</ID>
          <ToolTip>Property Name</ToolTip>
          <Default>MyProperty</Default>
          <Function></Function>
        </Literal>
        <Literal Editable="true">
          <ID>ownerclass</ID>
          <ToolTip>The owning class of this Property.  Typically the class that it is declared in.</ToolTip>
          <Default>ownerclass</Default>
          <Function>ClassName()</Function>
        </Literal>
        <Literal Editable="true">
          <ID>defaultvalue</ID>
          <ToolTip>The default value for this property.</ToolTip>
          <Default>0</Default>
          <Function></Function>
        </Literal>
      </Declarations>
      <Code Language="csharp" Kind="any" Delimiter="$"><![CDATA[

public $$type$$ $$property$$
{
    get { return ($$type$$)GetValue($$property$$Property); }
    set { SetValue($$property$$Property, value); }
}

// Using a DependencyProperty as the backing store for $$property$$.  This enables animation, styling, binding, etc...
public static readonly DependencyProperty $$property$$Property = 
    DependencyProperty.Register("$$property$$", $type$of($$type$$), $type$of($$ownerclass$$), new PropertyMetadata($$defaultvalue$$));

$end$]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>

Thanks for reporting this. I will investigate as soon as possible.