Search
On this page
Archives
RSS 2.0 Categories
Blogroll
Disclaimer
Powered by: newtelligence dasBlog 2.0.7226.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
Send mail to the author(s) E-mail
Updated Deep Dive CSS code#

Thanks to all the folks that came to my Deep Dive CSS for the ASP.NET Developer session at this past weekend's Atlanta Code Camp.  I got some really great feedback from the evaluations and will definitely incorporate some suggestions into this presentation in the future. 

The abstract, updated code and slides are available here:

 Deep Dive CSS for the ASP.NET Developer

 

Tuesday, April 01, 2008 9:25:35 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Visual Studio 2008 (Orcas) CSS tools#

I just returned from speaking at the Alabama Code Camp 5.0 in Birmingham.  One of my presentations was Deep Dive CSS for the ASP.NET Developer and I had hoped to spend some time on the tools in Orcas for working with Cascading Style Sheets.  Unfortunately, I did not get a chance to do that due to the time constraints, so I wanted to post some of my better links on that subject...

How to: Use the Apply Styles and Manage Styles Windows
http://msdn2.microsoft.com/en-us/library/bb398979(VS.90).aspx

            How to: Use the CSS Properties Window
           
http://msdn2.microsoft.com/en-us/library/bb398902(VS.90).aspx

How to: Use the Direct Style Application Toolbar
http://msdn2.microsoft.com/en-us/library/bb398977(VS.90).aspx

 

Monday, October 08, 2007 5:45:59 PM (GMT Standard Time, UTC+00:00)
  Comments [0]  | 
Google, Live, MSDN Search within Visual Studio 2008#

Since Matt Ranlett has now harassed me several times for removing the Google/MSDN macro from my blog, I decided to repost it.  I have added Live Search to the mix this time and I have tested all of the searches on Visual Studio 2008 Beta 2. 

 

The background on this was that I was spending a lot of time on Google and MSDN (aren't we all?) and was going back and forth from Visual Studio to the browser, so I decided to try and integrate my searches into Visual Studio.  The resultant experience is that you can highlight any text in Visual Studio and press your assigned keyboard shortcut and receive search results from your favorite search engines WITHIN the Visual Studio IDE.  It really comes in handy! 

 

In the code below, I have provided the URLs for searching against Google, Live, and MSDN.  It should be pretty obvious when you look at the macro what you would need to do to configure any other search engines.  Be sure to uncomment one (and only one) of the

url lines in the code when you setup each macro. 

 

For those not familiar with macros, here are the steps to add a macro in Visual Studio:

 

1)      Go to Tools | Macros | Macros IDE

2)      Once in the Macros IDE, you can create a new Module or you can just add this to the default “My Macros” module. 

3)      To add to My Macros, just right click on it in the Project Explorer and choose Add | Add New Item.  (if you don’t see the Project Explorer, try View | Project Explorer). 

4)      When the Add New Item Dialog shows up, select Code File and enter GoogleSearch and click OK.

5)      Paste the Code for GoogleSearch below into this file and save it.

     Make sure that you uncomment one of the url lines in the code. 

6)      Click Debug | Build and then close the Macros IDE.

7)      Once back in VS2005, click Tools | Customize and click the Keyboard button at the bottom of the Customize Dialog. 

8)      In the Show Commands Containing box, type “macros” and look for an entry that looks like this:  “Macros.MyMacros.GoogleSearch.GoogleSearch”.  (This could be different depending on where you created the macro). 

9)      Once you have the correct macro selected, go to the Press Shortcut Keys box and type whatever keys you want to fire the macro (I used Alt-G for Google, Alt-M for MSDN, Alt-L for Live). 

10)  Click the Assign button and then OK and then finally Close back on the Customize Dialog. 

11) Highlight any text in the IDE and fire off your shortcut key to test. 

12) Repeat for each search macro you want to setup. 

 

 

Here is the final code for the macro:

 

Imports EnvDTE

Imports System.Text.RegularExpressions

 

Public Module GoogleSearch

 

    Sub GoogleSearch()

        Dim url As String

        Dim selectedText As TextSelection = DTE.ActiveDocument.Selection()

 

        If Not String.IsNullOrEmpty(selectedText.Text) Then

            ' uncomment below for Google

            ' url = String.Format("www.google.com/search?q={0}", Regex.Replace(selectedText.Text, "\s{1,}", "+"))

            

            ' uncomment below for MSDN search

' url = String.Format("http://search.msdn.microsoft.com/search/Default.aspx?brand=msdn&query={0}", Regex.Replace(selectedText.Text, "\s{1,}", "+"))

 

' uncomment below for Live search

' url = String.Format("http://search.live.com/results.aspx?q={0}", Regex.Replace(selectedText.Text, "\s{1,}", "+"))

 

            DTE.ExecuteCommand("View.WebBrowser", url)

        Else

            MsgBox("No text selected.")

        End If

    End Sub

 

End Module

Monday, October 08, 2007 1:07:39 AM (GMT Standard Time, UTC+00:00)
  Comments [1]  | 
All content © 2008 , Rik Robinson