Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
 
 
Programming Blogs - Blog Catalog Blog Directory
 
 
 

Links

Social

Visual Studio add-in: CopySourceAsHTML

When I started with this blog I needed some tool to copy code snippets from Visual Studio to Windows Live Writer so I get formatted code. There is cool online code highlighter called GeSHi, but I wanted my code to look like in Visual Studio editor. After some searching I found Visual Studio add-in CopySourceAsHTML.

Copy As HTML... context menu After installing this add-in you can see new selection in code editor’s context menu: Copy As HTML… When you click on this menu then the following dialog with copy options will be opened.

copy-source-as-html-2

As you can see there are many so much options that these options are put on separated pages. When you paste code to Live Writer make sure you use Paste Special option. There you can say that you want to paste the code with formatting.

Here you can see cooperation between Visual Studio, CopySourceAsHTML and Windows Live Writer (horizontal bars are added by me).


public new void RaiseCallbackEvent(string eventArg)

{

    if (eventArgument.StartsWith("searchFieldChangedTo:"))

    {

        searchField = eventArg.Replace("searchField:", "");

        return;

    }

    else

    {

        var multiVal = new SPFieldMultiColumnValue(eventArg);

        if (multiVal.Count == 3)

        {

            searchOperator = multiVal[0];

            eventArg = eventArg.Replace(";#"+searchOperator, "");

            base.RaiseCallbackEvent(eventArg);

        }

        else

            base.RaiseCallbackEvent(eventArg);

    }

}


2009-08-06 Update Source of CopySourceAsHTML is now available in CodePlex.


kick it on DotNetKicks.com pimp it Progg it 顶 Shout it

Comments

SGWellens said:

That's odd.  I've been using CopySourceAsHTML (I even added a button to my toolbar for it) but your image shows a different layout (Wrap lines instead of Wrap words) and an extra check box (Include RTF).  I downloaded the latest (version 3.0.0) and the differences are still there.

Any ideas on why?

# February 9, 2009 11:46 AM

DigiMortal said:

I don't have 3.0.0 yet. It should be a little bit older version.

# February 9, 2009 2:48 PM

Dew Drop - February 10, 2009 | Alvin Ashcraft's Morning Dew said:

Pingback from  Dew Drop - February 10, 2009 | Alvin Ashcraft's Morning Dew

# February 10, 2009 10:17 AM

This Week on C9: jQuery, Win Mobile, Warcraft AddOn tools, and an Automed Bartender | CHARGED's Digital Lifestyle at Work or Play said:

Pingback from  This Week on C9: jQuery, Win Mobile, Warcraft AddOn tools, and an Automed Bartender | CHARGED's Digital Lifestyle at Work or Play

# February 21, 2009 7:17 AM

DotNetShoutout said:

Thank you for submitting this cool story - Trackback from DotNetShoutout

# August 5, 2009 4:04 PM

DotNetBurner - Third Party Tools said:

DotNetBurner - burning hot .net content

# August 5, 2009 4:05 PM

PimpThisBlog.com said:

Thank you for submitting this cool story - Trackback from PimpThisBlog.com

# August 5, 2009 4:06 PM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# August 5, 2009 4:08 PM

progg.ru said:

Thank you for submitting this cool story - Trackback from progg.ru

# August 5, 2009 4:09 PM

9eFish said:

9efish.感谢你的文章 - Trackback from 9eFish

# August 5, 2009 4:11 PM

Bob24 said:

To begin with, they are very small   indeed. ,

# October 23, 2009 6:10 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)