코딩하다가 문득 destructor Destroy; override 해주는게 갑자기 귀찮아 졌습니다. 그러다 갑자기 LiveTemplate 한번 맹글어 봐?.. 해서 뚝딱뚝닥... 생각보다 쉽군요..
<?xml version="1.0" encoding="utf-8" ?> <codetemplate xmlns=" http://schemas.borland.com/Delphi/2005/codetemplates" version="1.0.0"> <template name="destructor" invoke="manual"> <description> Destructor </description> <author> whitekid@gmail.com </author> <script language="Delphi" onenter="false" onleave="true"> InvokeClassCompletion; </script> <code language="Delphi" context="memberdecl" delimiter="|"><![CDATA[destructor Destroy; override;]]> </code> </template> </codetemplate>
View --> Templates를 선택하면 나오는 Templates에서 New로 만들로 destructor.xml로 저장한 후에... 코드에서 dest 치고 Ctrl + J ~ 뚝~
LiveTemplate 기능 좋습니다.~
with template은 보너스..
<?xml version="1.0" encoding="utf-8" ?> <codetemplate xmlns=" http://schemas.borland.com/Delphi/2005/codetemplates" version="1.0.0"> <template name="withc" invoke="manual"> <point name="selected"> <text>AClass</text> <script language="Delphi">InvokeCodeCompletion;</script> </point> <point name="params"> <text>Param</text> <script language="Delphi">InvokeCodeCompletion;</script> </point> <description> with object creations </description> <author> whitekid@gmail.com </author> <code language="Delphi" context="methodbody" delimiter="|"><![CDATA[with |selected|.Create(|params|) do try |end| finally Free; end; ]]> </code> </template> </codetemplate>
|