Click here to Skip to main content
15,887,812 members
Articles / All Topics

Visual Studio/Live Writer Tip: Format as Code

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
11 Jan 2011Ms-PL 9.8K   2   1
Live Writer extension for inserting code. Continue reading →

If you need to post a blog article containing code, and you happen to be using Visual Studio 2010 (VS), there’s a nice tool that provides an easy way to preserve its formatting and syntax coloration as it appears within VS.

It’s an extension for Windows Live Writer, created by Tim, which you can find by searching the Windows Live Writer gallery or going straight to Tim’s page at Windows Live gallery – Paste As Visual Studio Code.

Download this extension using the button on the web page. Launch the .msi file to install it. Now from within VS, you just select your code, CTRL+C to copy it to the clipboard, and then go over to your Live Writer blog and in your main menu-bar, select Insert > Paste As VS Code… and ahhhh… check it! You also get a nice panel of options to set, and you can save your customizations as a default.

C#
namespace RLib 
{ 
    /// <summary> 
    /// Providing this interface helps contribute a sort of 
    /// 'aspect-oriented programming' structure 
    /// by interjecting an Interlocution and other subsystems across the board. 
    /// </summary> 
    public interface IApp 
    { 
        /// <summary> 
        /// Provide access to the Interlocution class that provides us 
        /// with the various notification and logging services. 
        /// </summary> 
        IInterlocution Interlocution { get; } 

Very nice Tim!!!

by James W. Hurst

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)


Written By
Software Developer (Senior)
United States United States
Professional, contract software developer. I help with projects, give training seminars and do on-site project consultations. BTW I'm available for short & long-term contracts.

San Jose, CA

Comments and Discussions

 
Generalthanks for sharing - have 5 Pin
Pranay Rana12-Jan-11 21:58
professionalPranay Rana12-Jan-11 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.