开发辅助 - 宏

Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics


Public Module AnDequan


    'Ctrl +  小键盘 2


    Sub Self_MethodHeader_Ctrl_2()
        DTE.ActiveDocument.Selection.Text = "///"
        DTE.ActiveDocument.Selection.LineDown()
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "<remark>"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.LineUp()
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "<para/>Author   :  AnDequan"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "<para/>Date     :  " + FormatDateTime(Date.Today, 2)
    End Sub


    'Ctrl +  小键盘 1
    Sub Self_SingleLine_Ctrl_1()
        DTE.ActiveDocument.Selection.Text = "// []"
        DTE.ActiveDocument.Selection.CharLeft()
        DTE.ActiveDocument.Selection.Text = " "
        DTE.ActiveDocument.Selection.CharLeft()
        DTE.ActiveDocument.Selection.Text = " "
    End Sub


    'Alt + J


    Sub Self_Javascript_Alt_J()
        DTE.ActiveDocument.Selection.Text = "<script language=""javascript"" type=""text/javascript"">"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.LineUp()
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Save()
    End Sub




    'Alt + T + N
    Sub Self_Table_Normal_Alt_T_N()
        DTE.ActiveDocument.Selection.Text = "<table class=""normal"" bordercolor=""#a0c6e5"" cellpadding="""""
        DTE.ActiveDocument.Selection.CharLeft()
        DTE.ActiveDocument.Selection.Text = "0"
        DTE.ActiveDocument.Selection.CharRight()
        DTE.ActiveDocument.Selection.Text = " cellspacing ="""""
        DTE.ActiveDocument.Selection.CharLeft()
        DTE.ActiveDocument.Selection.Text = "0"
        DTE.ActiveDocument.Selection.CharRight()
        DTE.ActiveDocument.Selection.Text = " border=""1"">"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.LineUp()
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.NewLine()
    End Sub


    'Alt + T + T


    Sub Self_Table_Normal_tr_td_Alt_T_T()
        DTE.ActiveDocument.Selection.Text = "<tr>"
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.LineUp()
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.NewLine()
        DTE.ActiveDocument.Selection.Text = "<td>"
        DTE.ActiveDocument.Selection.CharLeft()
        DTE.ActiveDocument.Selection.Text = " class=""odd"""
        DTE.ActiveDocument.Selection.EndOfLine()
        DTE.ActiveDocument.Selection.Text = "<td>"
        DTE.ActiveDocument.Selection.CharLeft()
        DTE.ActiveDocument.Selection.Text = " class=""even"""
        DTE.ActiveDocument.Selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstText)
        DTE.ActiveDocument.Selection.Indent()
    End Sub


    'Alt + T
    Sub Self_InputText_Alt_T()
        DTE.ActiveDocument.Selection.Text = "<input id=""txt"" type=""text"" runat=""server"">"
        DTE.ActiveDocument.Selection.CharLeft(False, 31)
    End Sub


    'Alt + B
    Sub Self_InputButton_Alt_B()
        DTE.ActiveDocument.Selection.Text = "<asp:Button ID=""btn"" runat=""server"" Text="""" CssClass=""btn"">"
        DTE.ActiveDocument.Selection.CharLeft(False, 42)
    End Sub


    'Alt + E
    Sub Self_Eval_Alt_E()
        DTE.ActiveDocument.Selection.Text = "<%#Eval()"
        DTE.ActiveDocument.Selection.CharLeft()
        DTE.ActiveDocument.Selection.Text = """"""
        DTE.ActiveDocument.Selection.CharLeft()
    End Sub


End Module

你可能感兴趣的:(开发辅助 - 宏)