CopySourceAsHtml是一款能够以HTML格式拷贝源代码的Visual Studio 2005插件,拷贝后它会保持原有的高亮显示,这样代码在浏览器中和IDE编辑器中看起来是一样的。下载安装后它会在右键菜单中出现一项Copy As Html,有如下这样一段代码:
public class BLLServiceRegistry : WindsorContainer
{
private static BLLServiceRegistry instance = new BLLServiceRegistry();
public BLLServiceRegistry()
: base(new XmlInterpreter("App_Data/BLLConfigXml.xml"))
{
}
public static BLLServiceRegistry Instance
{
get { return instance; }
}
}
在IDE编辑器中,选择代码并点击右键选择Copy As Html:{
private static BLLServiceRegistry instance = new BLLServiceRegistry();
public BLLServiceRegistry()
: base(new XmlInterpreter("App_Data/BLLConfigXml.xml"))
{
}
public static BLLServiceRegistry Instance
{
get { return instance; }
}
}
粘贴到ASPX页面中,运行:
详情可以访问:http://www.jtleigh.com/people/colin/software/CopySourceAsHtml/