2009年3月4日 星期三

Delphi 2009 的函式說明自動完成模板

選擇 File -> New -> Other -> Code Template
將以下內容貼進去然後存檔
就可以按 Ctrl-J 選擇 summary,或是輸入 summary 之後按 Ctrl-J 自動出現函式說明的標籤了

<?xml version="1.0" encoding="utf-8" ?>
<codetemplate    xmlns="http://schemas.borland.com/Delphi/2005/codetemplates"
                version="1.0.0">
    <template name="summary" invoke="auto">
        <point name="comment">
            <hint>
                函數的說明文字
            </hint>
            <text/>
        </point>
        <description>
            Help Insight XML Documentation comment with "summary" element
        </description>
        <author>
            CodeGear
        </author>
        <code language="Delphi" context="methodbody" delimiter="|"><![CDATA[
/// <summary>
///   |comment|
/// </summary>
///   <param name="">
///   </param>
///   <param name="">
///   </param>
///   <param name="">
///   </param>
/// <returns>
/// </returns>
/// <remarks>
/// </remarks>]]>
        </code>
    </template>
</codetemplate>

沒有留言: