随笔-10  评论-9  文章-0  trackbacks-0

    '添加文件头定义
    Public Sub AddFileHead()

        Dim objTextSelection As TextSelection
        Dim comment As String
        objTextSelection = CType(DTE.ActiveDocument.Selection, EnvDTE.TextSelection)
        'objTextSelection.LineUp()
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "//==================================================================="
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "/** \file"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*  Filename: " + DTE.ActiveDocument.Name
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*  Desc:"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*  His:      Ipedo create @ " + Date.Now
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*/"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "//==================================================================="

    End Sub
    '添加文件函数定义
    Public Sub AddFunctionHead()

        Dim objTextSelection As TextSelection
        Dim comment As String
        objTextSelection = CType(DTE.ActiveDocument.Selection, EnvDTE.TextSelection)
        'objTextSelection.LineUp()
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "/** \brief"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + " " + "* 函数功能:"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "* 函数说明:"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "* \param  _f1   第一个浮点参数."
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "* \param  _f2   第二个浮点参数."
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "* \return  bool   返回两个浮点数是否相等.返回true时表示相等."
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "* 算法描述:"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "* (描述内容)"
        objTextSelection.NewLine()
        objTextSelection.Text = comment + "*/"

    End Sub

    Sub 文件注释()
        DTE.ActiveDocument.Selection.Text = "//==================================================================="
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "/** \file  "
        DTE.ActiveDocument.Selection.NewLine()
        'DTE.ActiveDocument.Selection.Indent()
        DTE.ActiveDocument.Selection.Text = "* Filename :   " + DTE.ActiveDocument.Name
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* Desc     :   "
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "* His      :   Windy create @" + Date.Now
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.DeleteLeft()
        DTE.ActiveDocument.Selection.Text = "*/"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "//==================================================================="
        DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
    End Sub

posted on 2005-12-02 14:46 Ipedo 阅读(670) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理