Geeks With Blogs

@jolson88
  • jolson88 You know, for supposedly being in the post-PC era, I'm seeing a lot of tweets about the new Mac in my Twitter feed. #fb about 408 days ago
  • jolson88 @Anyware I find the difference in perception fascinating (and frustrating). about 410 days ago
  • jolson88 @Anyware Agreed. I've often wondered whether apps like yours can do well in freemium. about 410 days ago
  • jolson88 @Anyware Curious, have you tried an ad-driven freemium approach? about 410 days ago
  • jolson88 @Anyware Thx for the write-up! You know, I've been curious how well the freemium model would work outside of games... about 410 days ago

News

Series

Add to Technorati Favorites


An Archived Managed World This blog has moved to http://www.managed-world.com/blog

Well, VSStyler is now ready for download. It is an add-in into Visual Studio .NET 2003 that allows you to save font and color settings into “styles”. This way, you can switch settings at the drop of a hat. I currently use this at work for a presentation/codeReview style and my regular programming style. It allows me to instantly change to either style I wish at anytime. I was hoping that we putting this out on the net, some of you might benefit from it, especially the presenters out there. It is the first add-in I have done with Visual Studio and is the first section of code that I have put out there on the internet, so be gentle okay ;)?

It was originally inspired by a similar add-in done by Roy Osherove. Except with Roy's add-in, there was only one style per file and you have to explicitly import or export to change one style. Regardless, it's a plug in that I found extremely useful at work but I felt I was not in a place to join his workspace and work on the product.

I decided to release this as a GotDotNet workspace so that everyone can have access to the source code and can modify/use it at will (except maybe just give credit were it's due, mm'kay?). You can find the workspace at http://www.gotdotnet.com/Community/Workspaces/workspace.aspx?id=722d7817-b935-4faf-9bf7-fe3e84d463af

Posted on Saturday, February 14, 2004 12:33 AM | Back to top


Comments on this post: Visual Studio Styler - Ready for Download

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
All I get from the download is an empty zipped file.

FYI
Left by K. Carter on Feb 14, 2004 10:32 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Save to File, rather than Open the .zip. It's a known bug.
Left by Johnny Hall on Feb 14, 2004 11:05 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
hmm, I just use the build in macro-capability: Tools > Macros > New Macro Project; and past this code in there...

'-----------------------------------------------------------
Imports EnvDTE
Imports System.Diagnostics

Public Module DemoUtils
Private Sub SetEditorFonts(ByVal size As Integer, ByVal family As String, ByVal bold As Boolean)
Dim Props As Properties
Props = DTE.Properties("FontsAndColors", "TextEditor")
Props.Item("FontSize").Value = size
Props.Item("FontFamily").Value = family

Dim clritems As EnvDTE.FontsAndColorsItems = Props.Item("FontsAndColorsItems").Object
clritems.Item("Plain Text").Bold = bold

End Sub

Sub DemoConfig()
SetEditorFonts(18, "Lucida Console", True)
End Sub

Sub NormalConfig()
SetEditorFonts(10, "Courier New", True)
End Sub



End Module
'-----------------------------------------------------------
Left by Rudi on Apr 05, 2004 8:25 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Well, a Macro is definitely an elegant way to go. However, for my needs, a macro would not be sufficient.

First of all, your sample doesn't handle colors. While it would be simple to add a "color" parameter to the SetEditorFonts() method, it does not account for different colors (background and foreground) for different properties (I use the white background with large text for demos, and I use a black background with white text (and pastel-like colors for keywords, comments, and such) for everyday coding).

Also, anytime I wanted to create a new style, I would need to go in and write another method. Or if I wanted to change a current style, I would need to go in and change the code. With the VSStyler, all I need to do is open it, select the style and click "Save" and all fonts, color, and such are saved into the styler file.

If you don't need to handle colors, I definitely think that perhaps the VSStyler is a bit overkill when it can be done quite simply in a Macro like shown above. Just my $0.02 though.
Left by Jason Olson on Apr 05, 2004 9:44 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
I had been looking for something like this, when I came over this site. Unfortunately, when I loaded up the plugin, I couldn't save any files, the "Unspecified Error" popped up and it disappeared when I unloaded the plugin.

Just thought you'd know
Left by P Andersen on Oct 24, 2004 8:38 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
It worked fine for me.
Do you have any example styles, just to see what other people are using as color schemes?
Left by Dustin Jones on Oct 25, 2004 5:25 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
great add-in.

I looked at the .styc file hoping to find either RGB or web HEX values for the color settings. What does the value of the color stored in the .styc file represent? Is there a way to convert it to RGB or HEX?
Left by mike h on Jan 06, 2005 1:42 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
It worked! I like it. It should have been buit in IMHO

Left by Justin on Jan 08, 2005 8:50 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Sorry for taking so long to respond Mike. The values represented for color in the .styc file are just the way that .NET serializes the color properties in this case, I believe. It's been a while since I looked at the code, but I believe it mostly uses .NET's default serialization capabilities.
Left by Jason Olson on Jan 19, 2005 2:18 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Justin, thanks! I consider that a great complement!
Left by Jason Olson on Jan 19, 2005 2:18 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
i like it
Left by vivek on Feb 02, 2005 8:29 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
I loved it...while it worked. No combination of closing VS (2003) installs, uninstalls, opening VS 2003, removing the add-in and restarts seem to make it work again. When I click on the little smiley face, nothing happens.

Given that this is an awesome little plug-in I really want it back (and Justin is right, there should be a built-in function like this, and one to collapse only comments using the outlining as well). Any ideas?
Left by Andy Brown on Mar 04, 2005 9:18 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
if anyone has some .styc files i can try out?
Please send them to bonna@pandora.be

I'll show you mine if u'll show me yours!
Left by Bonna on May 26, 2005 5:59 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
hi this is ananad
Left by anand on Jan 16, 2006 7:42 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
nice to use it .
Left by praneeth on Mar 05, 2006 2:08 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
gud to use!!
gud luck!!
Left by rajnish on May 17, 2006 2:25 AM

# A few suggestions
Requesting Gravatar...
I'm using VS 2003. There's two things I'd suggest fixing:

1. It seems that the Font family is being saved as "Microsoft Sans Serif" no matter what the current font is when you hit "save".

2. The xml in the .styc file is generated as one HUGE line. For us humans, it would really be helpful to break up those elements into individual lines, indented nicely of course. (That would make it really easy to hand-edit the data.)
Left by woz on Jun 23, 2006 4:18 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
I've been looking everywhere for something like this. For your next release, code you include some sample scheme files?
Left by Richard O'Neil on Jul 13, 2006 5:17 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
How about a 2005 version?
Left by BK on Aug 01, 2006 4:54 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Could you show me where i can download it
Now, M$ phased out all gotdotnet's workspaces ?
I asked Google for hours but no download link was found.

Thank you very much!
Left by Hung on Jul 20, 2007 3:48 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Hi Jason,

Is there any chance you could upload VSStyler somewhere, perhaps to CodePlex?

Thank you,

Jon Sagara
Left by Jon Sagara on Oct 25, 2007 1:13 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Hi Jason,

Did you got the chance to upload your code on another site like CodePlex?

Thanks for your great work.

Pascal.
Left by Pascal P. on Apr 14, 2008 1:31 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Did you got the chance to upload your code somewhere else?
Left by Looping2605 on Jan 05, 2009 7:57 AM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
Would LOVE to be able to get my hands on this as I just got stuck with a VS2003 project that can't be upgraded to a newer version.
Left by Leslie on Mar 18, 2009 5:13 PM

# re: Visual Studio Styler - Ready for Download
Requesting Gravatar...
I rewrote the macro above to import VS2005 themes into VS2003. Just download a VS2005 theme from http://studiostyl.es/ and rename it to C:\theme.vssettings. Then, run the following macro.

Imports EnvDTE
Imports System.Diagnostics
Imports System.Xml
Public Module Module1
Public Sub LoadVS2005ThemeInVS2003()
Dim _file As String = "C:\theme.vssettings"
Dim _doc As New XmlDocument
Dim _node As XmlNode
_doc.Load(_file)
_node = _doc.SelectSingleNode("/UserSettings/Category/Category/FontsAndColors/Categories/Category/Items/Item")
While Not _node Is Nothing
Dim _name As String = _node.Attributes("Name").Value()
Dim _foreground As System.UInt32 = System.UInt32.Parse(_node.Attributes("Foreground").Value().Substring(2), System.Globalization.NumberStyles.HexNumber)
Dim _background As System.UInt32 = System.UInt32.Parse(_node.Attributes("Background").Value().Substring(2), System.Globalization.NumberStyles.HexNumber)
Dim _bold As Boolean = IIf(_node.Attributes("BoldFont").Value.ToLower = "no", False, True)
Try
Dim clritems As EnvDTE.FontsAndColorsItems = DTE.Properties("FontsAndColors", "TextEditor").Item("FontsAndColorsItems").Object
clritems.Item(_name).Foreground = _foreground
clritems.Item(_name).Background = _background
clritems.Item(_name).Bold = _bold
Catch
End Try
_node = _node.NextSibling
End While
End Sub
End Module

Remember to add a reference to System.Xml in the Macro project
Left by WilliamS on Dec 10, 2010 10:46 AM

Your comment:
 (will show your gravatar)
 


Copyright © Jason Olson | Powered by: GeeksWithBlogs.net | Join free