[Cnblogs] Imitation Blog Park insert code for the Windows Live writer plugin

Source: Internet
Author: User

A plugin related display

Plug - ins:

Effects in Windows Live writer

"1"

"2"

"3"

The effect of the corresponding insert code in the blog is as follows:

"1"

 Public Static void Main (string[] args) {    int sum = 0;     for (int i = 0; i <; i++)    {        sum + = i;    }}

"2"

 Public Static void Main (string[] args) {    int sum = 0;     for (int i = 0; i <; i++)    {        sum + = i;    }}
View Code

"3"

  1publicstaticvoid Main (string[] args)  2 {   3     int sum = 0;   4for     (int i = 0; i < i++)  5     {  6         sum + = i;   7     }   8 }
Two development related notes

1, development is based on Wilco.SyntaxHighlighter.dll and WindowsLive.Writer.Api.dll (Windows Live Writer with), So after the development of the plug-in Memento.SourceCode.dll, together with Wilco.SyntaxHighlighter.dll copy to the Writer Directory plugins folder can be;

2, set the relevant property information of the plug-in in the SourceCodePluginContent.cs file

[Writerpluginattribute ("52f15949-eaf0-41b2-8364-f98a1abc6410", "mementocode", Publisherurl = " http://www.cnblogs.com/memento/", Description =" simulation of the recommended insertion code in the blog Park ", ImagePath ="Images.Q2.png ")]

Parameter 1:id, the GUID can be taken from the assembly information in the project properties;

Parameter 2: Name of the plugin display;

Parameter 3: links to plugins;

Parameter 4: introduction of the plugin;

Parameter 5: Icon for Plug-in (icon size 16*16, placed as Embedded resource under Folder "Images")

"Windows Live Writer's plug-in Options icon"

3, according to the Cnblogs Web page to insert code to try, you can get the corresponding style of the template, such as if it is a collapsed code snippet, the following style template:

1 <Div class="Cnblogs_code" onclick="Cnblogs_code_show (' {GUID} ')">2     <img ID="Code_img_closed_{guid}" class="code_img_closed" src="Http://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt="" />3     <img ID="Code_img_opened_{guid}" class="code_img_opened" style="Display:none;" onclick="Cnblogs_code_hide (' {GUID} ', event)" src="Http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt="" />4     <Div ID="Cnblogs_code_open_{guid}" class="Cnblogs_code_hide">{The code after the language is formatted}</Div>5 <span class="Cnblogs_code_collapse">{Collapse title}</span></Div>

where {GUID} is just one as a unique identifier, use GUID.NEWGUID () directly in C #. ToString () to get

Three references

1, reference the source code formatter project source code http://www.amergerzic.com/post/WLWSourceCodePlugin.aspx

2,writerpluginattribute parameter Description https://msdn.microsoft.com/en-us/library/aa702864.aspx

3,http://www.cnblogs.com/dflying/archive/2006/12/03/580602.html

Four Resources download

1,dll Download Http://files.cnblogs.com/files/memento/MementoSourceCode.zip

2, Project engineering download http://files.cnblogs.com/files/memento/Memento.SourceCode.7z

Have questions welcome to exchange discussion

[Cnblogs] Imitation Blog Park insert code for the Windows Live writer plugin

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.