Click here to Skip to main content
15,881,413 members
Articles / Silverlight

A Better Way to Organize your Silverlight Code Snippets

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
4 Jan 2011CPOL2 min read 7.8K   1  
A better way to organize your Silverlight Code Snippets

I hate re-writing code. I also hate it when I find a great code snippet on the web and forget to bookmark it or it gets lost in my endless sea of bookmarks. So what do you do to get around this? This is the question that I was asking myself at the end of 2010. How can I get my Silverlight code organized?

My requirements for a snippet manager were:

  1. Needs to be FREE.
  2. An easy way to view XAML/C# code behind together in one “view”.
  3. I wanted the ability to store the code snippets in cloud in case my HDD dies.
  4. Searchable Keywords to quickly find code snippets.

I started looking for a snippet manager that would allow me to do just that and finally found Snippet Manager.

Before going any further, I think that one of the most important things to note here is that this software supports 37 languages. It’s not just for Silverlight developers nor C# only guys. The software supports Java, SQL and even COBOL.

image

Below is a screenshot of the snippet manager that shows my Silverlight code snippet. You will notice that I have highlighted two sections. The top part is my XAML and the bottom is my C# code behind.

SNAGHTML18dc4471

I've included a sample below of my code snippets so that you can get an idea of how I organized it. Another thing that’s great about this software is that it supports plain text. I added some connection strings in the TEXT section below.

image

Once you have finished adding your code snippets, you can store them in the cloud. I created a FTP directory called “snippets” on my FTP Server and hit the upload button once I am finished adding my new code snippets. This will allow me to use the code snippets on another computer with this application on my USB Key. See screenshots below:

Enter your FTP credentials below:

SNAGHTML1906f846

Hit the Uploads button on the Toolbar:

image

Login to your FTP Server and verify the following files are now on the FTP Server:

image

Another great feature of the Snippet Manager is that you can also integrate this into VS2010 by clicking Tools –> External Tools:

image

And setting up your External Screen to point to the Executable:

SNAGHTML190df71d

You can now launch it by going to Tools –> Snippet Manager. If you want, you could also use a shortcut to launch the program with HotKeys.

image

As you can see, this is a nice little program that includes everything needed to organize your code snippets very clean. I didn’t go over every feature, but this is something that you might want to download and give it a shot.

Subscribe to my feed

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Telerik
United States United States
Michael Crump is a Silverlight MVP and MCPD that has been involved with computers in one way or another for as long as he can remember, but started professionally in 2002. After spending years working as a systems administrator/tech support analyst, Michael branched out and started developing internal utilities that automated repetitive tasks and freed up full-time employees. From there, he was offered a job working at McKesson corporation and has been working with some form of .NET and VB/C# since 2003.

He has worked at Fortune 500 companies where he gained experience in embedded systems design and software development to systems administration and database programming, and everything in between.

His primary focus right now is developing healthcare software solutions using Microsoft .NET technologies. He prefers building infrastructure components, reusable shared libraries and helping companies define, develop and automate process standards and guidelines.

You can read his blog at: MichaelCrump.net or follow him on Twitter at @mbcrump.

Comments and Discussions

 
-- There are no messages in this forum --