成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

利用Visual Studio 2008宏實現自動注釋

開發 后端
我們今天要介紹的是利用Visual Studio 2008宏實現自動注釋功能,希望這個小工具能給大家有所幫助。

1. Tool中選擇Macros,打開Macro IDE

2. MyMacros 刪除默認文件 Module1.vb,添加文件CommentHelper.Vb代碼內容

  1. Imports System  
  2. Imports EnvDTE  
  3. Imports EnvDTE80  
  4. Imports EnvDTE90  
  5. Imports System.Diagnostics  
  6. '注釋幫助模塊  
  7. Public Module CommentHelper  
  8. Sub AddClassComment()  
  9. '定義選擇區域  
  10. Dim DocSel As EnvDTE.TextSelection  
  11. '初始化選擇區域是當前文檔的選擇  
  12. DocSel = DTE.ActiveDocument.Selection  
  13. '選擇區域移動到文檔的開頭  
  14. DocSel.StartOfDocument()  
  15. DocSel.Text = "/*******************************************************************" 
  16. DocSel.NewLine()  
  17. DocSel.Text = "* Copyright (C) abc Corporation" 
  18. DocSel.NewLine()  
  19. DocSel.Text = "* All rights reserved." 
  20. DocSel.NewLine()  
  21. DocSel.Text = "*" 
  22. DocSel.NewLine()  
  23. DocSel.Text = "Author: HBB0b0 (hbb0b0@163.com)" 
  24. DocSel.NewLine()  
  25. DocSel.Text = "Create Date:" + DateTime.Now.ToString()  
  26. DocSel.NewLine()  
  27. DocSel.Text = "Description:" + DTE.ActiveDocument.Name  
  28. DocSel.NewLine()  
  29. DocSel.Text = "*" 
  30. DocSel.NewLine()  
  31. DocSel.Text = "* Date Author Description" 
  32. DocSel.NewLine()  
  33. DocSel.Text = "*******************************************************************/" 
  34. DocSel.NewLine()  
  35. End Sub 
  36. End Module 

3. 在需要添加注釋的項目中打開Macro 瀏覽器,如果看不到AddClassComment宏,則需要導入宏項目

4. 打開需要注釋文件,雙擊或運行AddClassComment,就會添加如下效果的注釋。

  1. /*******************************************************************  
  2. * * Copyright (C) abc Corporation  
  3. * * All rights reserved.  
  4. * *  
  5. * Author: HBB0b0 (hbb0b0@163.com)  
  6. * Create Date:2011-3-21 19:51:03  
  7. * Description:Program.cs  
  8. * *  
  9. * * Date Author Description  
  10. * *******************************************************************/  
  11. using System;  
  12. using System.Collections.Generic;  
  13. using System.Linq;  
  14. using System.Text;  
  15. namespace MacroApplication  
  16. {  
  17. class Program  
  18. {  
  19. static void Main(string[] args)  
  20. {  
  21. }  
  22. }  

如果覺得這種方式不方便,可以把它做成ToolBar,下個項目使用的只需要運行ToolBar中的對應按鈕就可以了。

1. Tools中選擇自定義

2. 新添ToolBar 名稱為CommentHelper

3. 在命令頁簽Macros選擇AddClassComment

4. 按住Macro.MyMacros.CommentHelper.AddClassComment,把它拖到CommentHelper容器上

5. 拖放后的效果如下

6. 在以后的使用時不用再次打開宏項目,直接單擊CommentHelperAddClassComment按鈕就可以添加類注釋了。

原文鏈接:http://www.cnblogs.com/hbb0b0/archive/2011/03/22/1990670.html

【編輯推薦】

 

  1. Visual Studio 2008在Web.config文件中注冊web用戶控件
  2. Visual Studio 2008中創建web用戶控件
  3. Visual Studio 2008的ListView數據排序
  4. Visual Studio 2008的標記導航功能
  5. Visual Studio 2008中綁定ListView控件
責任編輯:彭凡 來源: 博客園
相關推薦

2010-09-27 09:13:36

Visual Stud

2010-05-25 13:50:35

Visual Stud

2009-11-12 09:15:33

Visual Stud

2009-12-16 15:44:20

Visual Stud

2009-12-18 13:39:40

Visual Stud

2009-12-17 15:38:21

Visual Stud

2013-05-29 14:54:49

Visual Stud

2009-07-01 17:11:32

標記導航Visual Stud

2009-12-16 14:51:27

Visual Stud

2009-12-17 15:22:27

Visual Stud

2009-07-01 17:04:13

ListViewVisual Stud

2009-07-01 17:15:25

ListView數據排Visual Stud

2009-12-14 15:46:38

visual stud

2010-09-10 09:35:59

Visual Stud

2009-12-02 17:22:16

Visual Stud

2009-12-11 17:20:36

Visual Stud

2009-12-15 10:56:01

Visual Stud

2009-07-01 16:36:40

CSS樣式工具Visual Stud

2009-12-15 10:41:06

Visual Stud

2009-07-01 16:49:29

拆分視圖Visual Stud
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 性做久久久久久免费观看欧美 | 久久国内| 日韩在线观看视频一区 | 日本精品一区二区三区视频 | 国产精品国产成人国产三级 | 成人免费一级 | 国产一区二区三区四区 | 五月天激情综合网 | 神马久久久久久久久久 | 亚洲综合一区二区三区 | 一区二区三区视频在线 | www.四虎.com | 色婷婷综合久久久久中文一区二区 | 国产精品免费一区二区 | 亚洲成av人片在线观看 | 欧美一区二区三区视频 | 国产日韩一区二区三区 | 超碰在线97国产 | 精品一区二区三区在线观看国产 | 一级毛片视频 | 日韩精品久久久久久 | 91免费小视频 | 国产成人精品久久二区二区 | 久久久久综合 | 日韩二| 完全免费av在线 | 亚洲免费一区二区 | 国产精品一区二区三区在线播放 | 断背山在线观看 | 欧美国产一区二区 | 国产精品成人一区二区三区 | 成人一区二 | 亚洲精品一区二区三区 | 成人在线精品视频 | 日本高清不卡视频 | 欧美精品久久久久 | 中文字幕乱码视频32 | 日本一道本视频 | 成人亚洲精品 | 日韩在线| 亚洲女人天堂成人av在线 |