MethodStaticPrivate
Description
Generates a static private method with the given type and name.
Usage
[type] <name> msp
Example
string foo msp
Source Code
<?xml version="1.0" encoding="utf-8"?>
<Commands xmlns="http://schemas.devprojects.net/AutoCode/v4.0">
<Command name="MethodStaticPrivate" version="1.0">
<CommandBehavior>
<CommandLine shortcut="msp" />
<ActiveDocument extensions=".cs"/>
</CommandBehavior>
<CommandInfo>
<LanguageCategory>CSharp</LanguageCategory>
<Category>Members/Methods</Category>
<Usage>
<![CDATA[[type] <name> msp]]>
</Usage>
<Example>string foo msp</Example>
<Description>Generates a static private method with the given type and name.</Description>
<Author>DevProjects</Author>
<HelpUrl>http://help.devprojects.net/gallery/command/methodstaticprivate</HelpUrl>
</CommandInfo>
<CommandCode language="csharp">
<BeforeExecute>
<![CDATA[
if( Arguments.Length < 1)
{
CommandHelper.InvalidArguments("Please, specify the type and name (or just the name) of the method.");
return false;
}
if( Arguments.Length < 2)
{
Arguments = new string[] { "void", Arguments[0] };
}
return true;
]]>
</BeforeExecute>
<Codes>
<Code id="Code1">
<![CDATA[static private <#=args[0]#> <#=ToPascalCase(args[1])#>(]]>
</Code>
<Code id="Code2">
<![CDATA[)
{
}]]>
</Code>
</Codes>
<!-- Formats the rendered code; from the beginning of 'Code1' until the end of 'Code2' -->
<SmartFormat>
<Start codeElement="Code1" codePoint="StartOfElement" />
<End codeElement="Code2" codePoint="EndOfElement" />
</SmartFormat>
<!-- Positions cursor at the end of 'Code1', inside the parenthesis -->
<Selection codeElement="Code1" codePoint="EndOfElement" />
</CommandCode>
<Signature><![CDATA[
GekAyeqe1b7uYazXjsLPf8I39QMdavF1YM7CDCn8K31BRCRkvrjo0rzeb
5vveRKYKgh4x//BPeqV2GHmduoiBjKUP5b35giQEJ5pQHBWVNCGBpMX9a
PAaZHpCdUa0CZO0r23Gsa/ECXq3DheZEzFc812PfxH/fX8Aga8hluBsmw=
]]></Signature>
</Command>
</Commands>