trying to write a VS2010 C# code snippet that has a closing square bracket as part of new object array assignment, basically so:
<Code Language="CSharp">
<![CDATA[public void $MethodName$($parameters$)
{
if(InvokeRequired)
{
ZPICD icdzp = new ZPICD($MethodName);
Invoke(icdzp, new object[] { });
}
else
{
$selected$
}
}
public delegate void ZPICD();]]]>
</Code>
doesn't look like there is a lot on the subject, both bing and google are giving weak results for searches like: escape square brackets in C# snippet C# snippet square brackets C# code snippet square brackets
There is no need for square bracket escape codes, the parser looks to be keeping track of the square bracket depth level through the body of the snippet. The problem was a missing replacement token delineator.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With