Reputation: 2230
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
Upvotes: 3
Views: 2837
Reputation: 2230
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.
Upvotes: 1