Changing the Projects Version

The following code may be used in the Macro Studio. It will update the AssemblyInfo files to reflect them with a given version. When the files are required to be chacked out, it will happen automatically.


''' <summary>
''' For all projects in the solution,
''' change the version to a given version
''' </summary>
''' <remarks>some items in the solution might produce an exception
''' for istance if they are not loaded, or they have no vesion
''' </remarks>
Sub ChangeVersionProperties()
Dim sol = DTE.Solution
Dim projectT As EnvDTE.Project = sol.Projects.Item(1)
Dim newVersion As String = "1.200.0.9"

For Each project As EnvDTE.Project In sol.Projects
Try
Debug.Write(project.Name)
Debug.Write(
" changes from ")
Debug.Write(project.Properties.Item(
"AssemblyFileVersion").Value)
Debug.WriteLine(
" to " + newVersion)
project.Properties.Item(
"AssemblyFileVersion").let_Value(newVersion)
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(project.Name +
" kon niet gezet worden: " + ex.Message)
End Try
Next
End Sub

Collapse &amp Expand Code

When I use Visual Studio IDE to edit an XML file, I often come accross a big tree that is not easily to find my way out. So I start to collapse the expanded nodes. Unfortunately it might be very hard to do this.
So I was looking for a macro to do it and found the following macro which I attached a toolbar icon to it:



'' Toggle the current row and go down one line
Sub ToggleOne()
Dim cmd As String = "Edit.ToggleOutliningExpansion"
Dim ts As TextSelection = DTE.ActiveDocument.Selection

DTE.ExecuteCommand(cmd)
ts.LineDown()

End Sub