My personal thoughts about life, work, family, kids, and love.. RSS 2.0
# Wednesday, September 23, 2009

http://blogs.msdn.com/saraford/archive/2009/09/09/teched-australia-25-visual-studio-2008-ide-tips.aspx

 

The ones I found most useful (or didn’t already know) include:

Prevent copying blank lines with Ctrl+C

Look in Tools - Options - Text Editor - All Languages - General. Unchecking 'Apply Cut or Copy commands to blank lines when there is no selection' prevents copying a blank line into the clipboard.  How did I ever miss this checkbox!?

 

Incremental Search

This allows me to jump to the next match as I type it out. I LOVE it!!

   1. Press Ctrl+I
   2. Start typing the text you are searching for.  note: you'll see the cursor jump to the first match, highlighting the current search string.
   3. Press Ctrl+I again to jump to the next occurrence of the search string
   4. (advanced tip) Press Ctrl+Shift+I to search backwards
   5. To stop searching, press ESC

You’ll note that it is case-sensitive, unfortunately. I’ll have to look for a way to change that..

 

And, my total favorite is..

Customize how search results are displayed

This is one of the most irritating things ever about Visual Studio. The Find Results window is almost always filled with only the paths of the found files, instead of the line details. I always have to scroll to the right to see the details. Here is the direct link to the article, bypassing the roundup.

http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx

Wednesday, September 23, 2009 8:04:00 PM (Mountain Daylight Time, UTC-06:00)  #    Comments [0] - Trackback
Visual Studio

I created a simple utility that can customize the Visual Studio Find Results output. I think using it should be pretty self-explanatory..

VSFindResultsEditor

I wanted something new to do this morning, what can I say!?

Download it here!

 

You can also check out Sara Ford’s blog for all the glorious details about customizing the Visual Studio Find Results output:

http://blogs.msdn.com/saraford/archive/2008/11/24/did-you-know-you-can-customize-how-search-results-are-displayed-in-the-find-results-window-363.aspx

Wednesday, September 23, 2009 2:59:00 PM (Mountain Daylight Time, UTC-06:00)  #    Comments [0] - Trackback
Visual Studio
# Friday, September 18, 2009

Here are a few macros that I use, that I thought might be of use to others. They should be fairly easy to set up in your environment. I’m always excited to hear about new macros and plugins and other time-saving functionality for Visual Studio, so if you have any – please let me know!!

Misc Built-in Macros

Here are some basic macros that came with Visual Studio 2008 (and VS 2005) that are very useful and easily map to your favorite keyboard shortcut(s).

Macros.Samples.Accessibility.IncreaseTextEditorFontSize
Macros.Samples.Accessibility.DecreaseTextEditorFontSize 
Macros.Samples.Accessibility.UpdateTextEditorFontSizeToMatchDisplayProperties 
Macros.Samples.Utilities.TurnOnLineNumbers 
Macros.Samples.Utilities.TurnOffLineNumbers 
Macros.Samples.VSEditor.BeginningOfFunction 
Macros.Samples.VSEditor.LineEmUp (Good for aligning variable assignments) 
Macros.Samples.DevStudio6Editor.AutoCompleteFromFile

Format Source Code

I map F2 to the standard Edit.FormatDocument command and Ctrl+F2 to the FormatCSharp macro method.

Public Sub FormatCSharp()

   Try
      ' Remove and sort using statements if PowerCommands is installed.
      DTE.ExecuteCommand("Edit.RemoveAndSort")
   Catch ex As Exception
      
   End Try

   Try
      DTE.ExecuteCommand("Macros.Samples.VSEditor.FixLineEnds")
   Catch ex As Exception
      Exit Sub
   End Try

   DTE.ExecuteCommand("Edit.FormatDocument")

End Sub

Attach to IIS Worker Processes

I map Ctrl+P to this macro, replacing the default Print Current Document shortcut.

Sub MacroAttachToAllWebProcesses() 
   Try 
      Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger 
      Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default") 
      Dim dbgeng(3) As EnvDTE80.Engine 

      dbgeng(0) = trans.Engines.Item("T-SQL") 
      dbgeng(1) = trans.Engines.Item("T-SQL") 
      dbgeng(2) = trans.Engines.Item("Managed") 

      ' Use . for local machine or type machine name 
      For Each theProcess As EnvDTE80.Process2 In dbg2.GetProcesses(trans, ".") 
         If theProcess.Name.Contains("aspnet_wp.exe") 
               Or theProcess.Name.Contains("w3wp.exe") Then 
            theProcess.Attach2(dbgeng) 
         End If
      Next

   Catch ex As System.Exception 
      MsgBox(ex.Message) 
   End Try 

End Sub

Solution Events

' Automatically close all documents when the solution is closed.
Private Sub SolutionEvents_BeforeClosing() Handles SolutionEvents.BeforeClosing
   DTE.ExecuteCommand("Window.CloseAllDocuments")
End Sub

Build Events

' A project failed to compile, so cancel remaining and beep
Private Sub BuildEvents_OnBuildProjConfigDone(ByVal Project As String, ByVal ProjectConfig As String, _
ByVal Platform As String, ByVal SolutionConfig As String, ByVal Success As Boolean) Handles BuildEvents.OnBuildProjConfigDone If Success = False Then DTE.ExecuteCommand("Build.Cancel") ' System.Windows.Forms.MessageBox.Show("Build failed!") Beep() Threading.Thread.Sleep(500) Beep() Threading.Thread.Sleep(500) Beep() Threading.Thread.Sleep(500) Beep() End If End Sub ' The build finished successfully Private Sub BuildEvents_OnBuildDone(ByVal Scope As EnvDTE.vsBuildScope, ByVal Action As EnvDTE.vsBuildAction) _
Handles BuildEvents.OnBuildDone If (Not failed) Then ' System.Windows.Forms.MessageBox.Show("Build is complete!") Beep() Threading.Thread.Sleep(250) Beep() End If End Sub
Friday, September 18, 2009 8:16:00 PM (Mountain Daylight Time, UTC-06:00)  #    Comments [0] - Trackback
Visual Studio
# Friday, October 03, 2008
PowerCommands for Visual Studio 2008 is definitely one of the best plug-ins available for Visual Studio..

Includes things like:
 
  • Undo closed window
     
  • Collapse all projects
  • Copy path
  • Email CodeSnippet
  • Insert GUID from right-click menu
  • Copy and paste project references!
  • Open containing folder
  • Open command prompt
  • Unload project
  • Sort using statements / also removes un-used ones
  • And more..

  • Friday, October 03, 2008 5:08:00 PM (Mountain Daylight Time, UTC-06:00)  #    Comments [0] - Trackback
    Visual Studio
    Navigation
    Categories
    Archive
    <March 2010>
    SunMonTueWedThuFriSat
    28123456
    78910111213
    14151617181920
    21222324252627
    28293031123
    45678910
    About the author/Disclaimer

    Disclaimer
    The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

    © Copyright 2010
    Kody Brown
    Sign In
    Statistics
    Total Posts: 3
    This Year: 0
    This Month: 0
    This Week: 0
    Comments: 0
    Themes
    All Content © 2010, Kody Brown
    DasBlog theme 'Business' created by Christoph De Baene (delarou)