Tue Aug-05-2008
 
IImports System
Imports EnvDTE
Imports EnvDTE80
Imports System.Diagnostics
 
 
Public Module Module1
    Sub Attach2()
        Try
            Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
            Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
            Dim dbgeng(1) As EnvDTE80.Engine
            dbgeng(0) = trans.Engines.Item("Native")
            Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "wm-elinsd-pc").Item("spoolsv.exe")
            proc2.Attach2(dbgeng)
        Catch ex As System.Exception
            MsgBox(ex.Message)
        End Try
 
    End Sub
    Sub AttachToSpooler()
        Try
            Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
            Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
            Dim dbgeng(1) As EnvDTE80.Engine
            dbgeng(0) = trans.Engines.Item("Native")
            Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "wm-elinsd-pc").Item("spoolsv.exe")
            proc2.Attach2(dbgeng)
        Catch ex As System.Exception
            MsgBox(ex.Message)
        End Try
    End Sub
 
    Sub SaveBP()
        Dim oFile As System.IO.File
        Dim oWrite As System.IO.StreamWriter
        Dim bps As Breakpoints
        Dim bp As Breakpoint
 
        oWrite = oFile.CreateText("C:\Documents and Settings\elinsd\My Documents\Data\VS\bp.txt")
        bps = DTE.Debugger.Breakpoints
        If (bps.Count() > 0) Then
            For Each bp In bps
                oWrite.WriteLine(bp.Name)
            Next
        Else
            oWrite.WriteLine("No Breakpoints are set")
        End If
 
        oWrite.Close()
    End Sub
 
    Sub LoadBP()
        Dim iFile As System.IO.File
        Dim iRead As System.IO.StreamReader
        Dim bps As Breakpoints
        Dim Line As String
 
        If (False) Then
            bps = DTE.Debugger.Breakpoints
            If (bps.Count() > 0) Then
                DTE.ExecuteCommand("Debug.ClearAllBreakpoints")
            End If
        End If
 
        iRead = iFile.OpenText("C:\Documents and Settings\elinsd\My Documents\Data\VS\bp.txt")
        While iRead.Peek <> -1
            Line = iRead.ReadLine()
            DTE.Debugger.Breakpoints.Add(Line)
        End While
 
        iRead.Close()
    End Sub
    Sub RebuildGarnetMonitor()
        DTE.ActiveWindow.Object.GetItem("GarnetLanguageMonitor\LanguageMonitor").Select(vsUISelectionType.vsUISelectionTypeSelect)
        DTE.Windows.Item(Constants.vsWindowKindOutput).Activate()
        DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Rebuild")
    End Sub
    Sub RebuildKodakMonitor()
        DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate()
        DTE.ActiveWindow.Object.GetItem("SGTL_Kodak_LanguageMonitor\LanguageMonitor").Select(vsUISelectionType.vsUISelectionTypeSelect)
        DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Rebuild")
    End Sub
    Sub RebuildSGTLMon()
        DTE.Windows.Item(Constants.vsWindowKindSolutionExplorer).Activate()
        DTE.ActiveWindow.Object.GetItem("SGTLMon\LanguageMonitor").Select(vsUISelectionType.vsUISelectionTypeSelect)
        DTE.ExecuteCommand("ClassViewContextMenus.ClassViewProject.Rebuild")
    End Sub
End Module
Previous  |  Next ]     [ Up  |  First  |  Last ]     (Article 300 of 485)
 
Comments, flames, broken links?
Please send email to maintainer@intricate-simplicity.com