Monday, November 30, 2009

Source Code Browser

I hadn’t gotten a chance to play with Silverlight 4’s new RichTextArea control before PDC but really wanted to give it a try. With the holidays I was finally able to give it a try on an app that I had been wanting to put together for a while- a source code browser that works similarly to Flex’s source code publishing feature.

What I did was put together an app that downloads a zipped up project file from the server, finds all of the solution files then parses the solutions and projects to create a project browser. When a file is selected it gets displayed in a RichTextArea with some primitive syntax highlighting.

This way rather than having to go through the bother of downloading the source code, unzipping it, opening it in VS just to see a chunk of code, you can easily browse it in the web page. By working off of zipped projects, it doesn’t require any additional steps to publish beyond what I was already doing in uploading the zipped source.

And thanks to Ben Lemmon who helped out with some code to parse the ZIP file headers making it easy to walk the files of a ZIP package.

Source Code Browser Source (and demo of it in action)

2 Comments:

Blogger Big Daddy said...

Hi Pete, I have a question unrelated to this blog post. Does your snoop program work for Silverlight apps?
thanks in advance,
John

9:08 AM  
Blogger sport8341 said...

cell phones
NFL Jerseys
tn chaussures
Chaussures Sport
NFL Jerseys

Cheap Polo Shirts
chaussures puma
Tn Requin
Cheap Polo
Air Max
Chaussures Nike Sport

9:07 PM  

Post a Comment

<< Home