Use the CodeModel Object to Analyze Code

 < Free Open Study > 

Open All Code and Designer Windows

If, for some reason, you would like to open all of the code and designer windows in the project, the following procedure will do that for you. It does not open the AssemblyInfo.vb file because you would not normally change this file.

    Sub OpenAllWindows()        Dim pi As ProjectItem        Dim prj As Project        Dim sln As String = DTE.Solution.Item(1).Name        On Error Resume Next        For Each prj In DTE.ActiveSolutionProjects            For Each pi In prj.ProjectItems            'Debug.WriteLine(pi.Name)            If pi.Name.ToUpper.EndsWith(".VB") And _               pi.Name.ToUpper <> "ASSEMBLYINFO.VB" Then               Dim pn As String = prj.Name               Dim s As String = pi.Name.ToString               ' GetType(Sln.Name\\               Dim s2 As String = sln & "\" & pn & "\" & s               DTE.Windows.Item(Constants.                   vsWindowKindSolutionExplorer).                   Activate()               DTE.ActiveWindow.Object.GetItem(s2).Select(                   vsUISelectionType.vsUISelectionTypeSelect)               DTE.ActiveWindow.Object.DoDefaultAction()               'System.Windows.Forms.Application.DoEvents()               Dim doc As Document = DTE.ActiveDocument()            End If        Next      Next    End Sub

 < Free Open Study > 

Writing Add-Ins for Visual Studio  .NET
Writing Add-Ins for Visual Studio .NET
ISBN: 1590590260
EAN: 2147483647
Year: 2002
Pages: 172
Authors: Les Smith © 2008-2017.
If you may any questions please contact us: