Read My Tweets
Ever feel like you're not getting the best experience on the web?
Get Silverlight to see the whole site!

TUTORIAL #6: Visual Studio Code Highlighting To HTML

Tuesday, October 07, 2008


Many times when I'm writing a blog post, I want to include some of the source code from the project I am talking about. For most people, seeing the syntax highlighted the way it is in Visual Studio makes it the most readable. I've tried it manually, and it's very hard to do. (At least to do quickly.)

Then I discovered that there was a plug-in for Live Writer (actually, there's like 6.) But Live Writer has some quirks working with my blogging engine, so I really struggled with it (even though the code looked awesome!)

Today I almost just sat down and wrote my own converter, that would take source code from Visual Studio, and translate it into CSS styles. But I figured one more trip around the web couldn't hurt, so I headed to my favorite search engine and started hunting. The very first entry was exactly what I was looking for.

A guy named Douglas Stockwell has created a tiny little executable that interacts with your clipboard in Windows. He actually created one of the Live Writer plug-ins as well. The basics of the application he wrote is this. Copy some source code to your clipboard (Ctrl + C), run this executable, and then paste (Ctrl + V) your newly formatted HTML into your blog engine, HTML page, etc. It even allows for customization of fonts and sizes, just by renaming the .exe file. For example, renaming it from vs2html.exe to vs2html.arial.10.exe will make the default font Arial in 10 point size. My setting is Consolas 11.

The program he created is called VS2HTML, and it's freely available. You can download it here.

kick it on DotNetKicks.com

Labels: , , , ,

posted by Jeff Blankenburg, 2:09 PM | link | 0 comments |

Silverlight Layout Options - Canvas (Part 1 of 3)

Friday, June 06, 2008


There are many decisions to be made when you're building a new application, and Silverlight introduces some new (but old) paradigms when it comes to the layout of your interface.

In this first part of three articles, we're going to be talking about the <Canvas> option. I equate this to a more familiar concept in HTML known as absolute positioning. Each element will be given its own specific location on the page, and nothing but code can move them. This is also one of the downfalls of the <Canvas>, but for many apps, this may not matter.

With elements absolutely positioned, things just don't adjust. If a user resizes their browser, the elements don't move. If a user tries to see your application on a smaller screen than you anticipated, part of the app is going to be hidden. (Think mobile phones, for example...if you position everything out to fit in a window 800 x 600, that 320 x 200 screen is not going to show very much).

However, this is still one of the fastest ways to get your elements positioned on a page, and the taboos that came with absolute positioning in CSS are erased, because we're now developing in a universal plugin, not 17 flavors of browser and platform combinations.

So how do we do it? Here's some example code:

Click to see this running...

As you can see, it's pretty straightforward. We have a button, an ellipse, and a rectangle, and their positions are defined by the Canvas.Left and Canvas.Top attributes. You can also nest <Canvas> tags, and the Left and Top attributes apply to the immediate parent of the element you are positioning.

Click here to see the code above running in a browser.

(continue to Part 2...and Part 3...)

Labels: , , , ,

posted by Jeff Blankenburg, 8:34 AM | link | 0 comments |

Mix 07! I'll be there!

Wednesday, January 24, 2007

I'm Going To Mix 07!  Elvis Will Be At Mix 07!  Let's Mix at Mix 07!  Roll the dice with me at Mix 07!


So I know I just got back from an amazing conference in CodeMash, but I've got great news! I'm heading to Mix 07 at the end of April, thanks to the good folks at Quick Solutions. Brian Prince and the rest of the management team do nothing but support me and my technical growth. I can't thank them enough for the opportunities they have provided me.

It's taking place in the Venetian Hotel & Casino in Las Vegas, NV from April 30 - May 2, 2007. I'll actually be heading out the morning of the 29th, and flying home to Columbus on May 3rd, so it should make for an exhausting trip. Based on the preliminary schedule of events, here's how I see my schedule going down:

April 29, 2006
7:00 AM - Get to the Columbus Airport, check in, go through security checkpoints, recover from cavity search.
9:00 AM - Take the flight to Sin City.
10:38 AM - Arrive in Las Vegas. We are now operating on Vegas time people, keep up.
10:39 AM - Lose my first $10 in a slot machine.
11:00 AM - Check in to the Venetian Hotel & Casino.
11:30 AM - Lose another $50 at the blackjack table.
12:00 PM - Grab some lunch.
12:45 PM - Wander the hotel, getting my bearings on where registration, session rooms, etc. are.
4:00 PM - Head over the registration, get checked in for the event.
5:00 PM - Sit down for a long night of Texas Hold-em at the Bellagio Poker Room (or maybe the Venetian Poker Room, it looks to be new)


April 30, 2006
1:00 AM - Go to bed.
8:30 AM - Head down to the Continental Breakfast. Mingle. Meet some people.
9:30 AM - Head over the Keynotes session. Ray Ozzie and Scott Guthrie are expected to be speaking. I really enjoyed Scott's talks at CodeMash, so I hope there is new material for Mix.
12:00 PM - Lunch
1:30 PM - Time for some sessions.


Um, I expected this blog post to be longer, but it doesn't appear that they have decided which sessions will be in which time slots. So, of the sessions that are listed on the site currently, here are the ones I expect to attend:


LINQing Your Web Applications - See how Language-Integrated Query (LINQ) allows for the most seamless integration of your Web applications and relational data. Get a sneak peek at the next version of the .NET Framework and Visual Studio (codenamed “Orcas”).

Driving Your Business through User Experience - Hear how tools, technologies and cutting edge design combine to create the user experiences that drive your business. See how a continuum of user experiences can be a powerful lever to differentiate the products and services you offer via the Web.

Gazing into the Future of Web Development - Be one of the first to see the big advances planned for the next version of ASP.NET for building rich Web applications. Get a sneak peek at technology to help simplify rich content, data, services and more. Learn how to efficiently and effectively create data-driven applications that fully leverage the power of “WPF/E” and AJAX on the client coupled with powerful server-side features provided by ASP.NET.

Thinking in CSS: How to Build Great Looking Sites - Delve into CSS with Molly Holzschlag, and look at the power CSS offers to Web developers and designers. Hear Molly's secrets about how to build stunning sites quickly and easily.

Five Real World Applications that Raise the Bar for User Experience - Come learn about five applications that will change what your customers will expect from tomorrow’s software applications.

IE7 Retrospective: Microsoft's Look at the Good, Bad and Ugly - Hear from Microsoft's IE7 team about the journey from mea culpa to broad market acceptance. Hear what went right, what had to be cut, and how development priorities are set. Learn how to minimize your Web browser support headaches, and move to a more standardized Web.

There are plenty more sessions planned, and my preference may change once I see which sessions are in which time slots. Expect to see many more posts about this in the near future. And for those of you that want me to put $1 on Red 32 for you while I'm there, start saving your pennies.

Labels: , , , , , , , , , , , , , , , , ,

posted by Jeff Blankenburg, 2:33 PM | link | 2 comments |

Windows Developer Power Tools

Thursday, January 11, 2007

I've been published! Last fall, I was approached about writing an article on HTML validation services for a book authored by Jim Holmes, and I did. On January 19 (during CodeMash, no less), the book will be released to the masses.



It was fun to write for this book, and I got my copy of it yesterday. I got 9 pages, of the 1,217 pages in the book. I've already read most of it during the review process, but to toot my own horn, here's an excerpt from my section:

Valid markup is not just a status symbol. Seperating your content from your layout benefits you in many ways. The point of publishing on the Web is to reach the broadest audience possible, and adhering to Web Standards is the best way to ensure that you meet this goal. Cell phones, nontraditional devices such as screen readers, and tomorrow's unreleased devices will support web standards, but those little tricks you use in IE may well not be supported in the future. Get it right the first time by using a validator - the time and money it will save you in the long run will make the upfront investment worth your while.


Get your copy of Windows Developer Power Tools at Amazon.com today!

Labels: , , , ,

posted by Jeff Blankenburg, 9:24 AM | link | 0 comments |