Recommended Reading

MethodInternal

Description

Generates a internal method with the given type and name.

Usage

[type] <name> mi

Example

string foo mi

Source Code

<?xml version="1.0" encoding="utf-8"?>
<Commands xmlns="http://schemas.devprojects.net/AutoCode/v4.0">
  <Command name="MethodInternal" version="1.0">
    
    <CommandBehavior>
      <CommandLine shortcut="mi" />
      <ActiveDocument extensions=".cs"/>
    </CommandBehavior>

    <CommandInfo>
      <LanguageCategory>CSharp</LanguageCategory>
      <Category>Members/Methods</Category>
      <Usage>
        <![CDATA[[type] <name> mi]]>
      </Usage>
      <Example>string foo mi</Example>
      <Description>Generates a internal method with the given type and name.</Description>
      <Author>DevProjects</Author>
      <HelpUrl>http://help.devprojects.net/gallery/command/methodinternal</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[internal <#=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[
      s3hUHeBvvwdZvDxwsNci3QaRyGqYMeDKKycwJp/+GJb+pXaOcsSilLZJz
      V2uA+pgPakY0n9L8GKx3GFlI9MDDhgflH9qk2sTdFWUODhXtq2QUvDmlb
      eWjHMLD6I1w0fpqyq5US+iyB9ktFf9wNf+wW4lbXsFfQpnzfGy3Isz3e8=
    ]]></Signature>

</Command>
</Commands>