Recommended Reading

SurroundTag

Description

Surrounds selected text with an element tag.

Usage

(Select Text) name s

Example

Source Code

<?xml version="1.0" encoding="utf-8"?>
<Commands xmlns="http://schemas.devprojects.net/AutoCode/v4.0">
  <Command name="SurroundTag" version="1.0">
    <CommandBehavior>
      <CommandLine shortcut="s" delimiter="@#@" />
      <ActiveDocument requiresSelection="true" extensions=".master;.aspx;.ascx;.asmx;.autox;.xml;.html;.htm;.css;.txt;.tt"/>
    </CommandBehavior>

    <CommandInfo>
      <LanguageCategory>Markup</LanguageCategory>
      <Category>Misc</Category>
      <Usage>(Select Text) name s</Usage>
      <Description>Surrounds selected text with an element tag.</Description>
      <Author>DevProjects</Author>
      <HelpUrl>http://help.devprojects.net/gallery/command/surroundtag</HelpUrl>
    </CommandInfo>

    <CommandCode language="csharp">

      <Codes>

        <Code id="Code1" codeElement="Selection" codePoint="StartOfSelection" smartFormat="false">
          <![CDATA[<<#=args[0]#>>]]>
        </Code>

        <Code id="Code2" codeElement="Selection" codePoint="EndOfSelection" smartFormat="false">
          <![CDATA[</<#=args[0]#>>]]>
        </Code>

      </Codes>

      <SmartFormat>
        <Start codeElement="Code1" codePoint="StartOfElement"/>
        <End codeElement="Code2" codePoint="EndOfElement"/>
      </SmartFormat>

      <Selection />

    </CommandCode>
    <Signature><![CDATA[
      CKiV+QvPAVWZ1jnCJfUbDIdaXjaWcFrragwuG3Ouit2Kz+VrnJ1YAB/it
      PAK35y6+WdyMZE3iRibotRLwGqdvWwJg+YyQvsiQ+iwkaXCJHCWVyQAhH
      rG6idXFL8pmNjd81W2Ny+ZHkgExnDd+iCt5nD2QNJ0/RWhvxCwBFT+mqE=
    ]]></Signature>

  </Command>
</Commands>