Friday, April 20, 2007

New source copy helper for Windows Live Writer

Are you already tiered of BlogMyCode or CopyAsHTML popup windows and non-standard right-mouse-click-do-something-then-maybe-I-help-you dialogs? Let me introduce my last plugin for Windows Live Writer blog client - Code Past Plugin. It's really simple as it should be. This plugin uses standard copy functions from anywhere (no only from VS2005). Then it converts code into XHTML and put it into WLW window. Don't this should work this way? Without right clicks and unnecessary windows? Download it now and use it. Here the sample format of code. You can optionally add header or line numbering. You can even break lines (if you wish). The other feature I added is new clipboard detection, so if you has something really wrong there and already opened code adding dialog, you don't have to close it and copy something else, just switch to Studio, copy new code and the plugin will detect all your changes.

Code Snippet
        private void btOK_Click(object sender, EventArgs e)
{
this.Close();
}

string getOptionText()
{
if (actCode != string.Empty)
{
StringBuilder sb = new StringBuilder();
if (cbLinesNum.Checked)
{
string[] outp = actCode.Replace(@"\r\n", "\r").Split('\r');

int offset = 0;
for (int i = 0; i < outp.Length; i++)
{
if (outp[i].Trim() == string.Empty)
{
sb.Append(
"<br/>");
offset++;
}

 


Here it's configuration window with preview.


image


If you catch bugs or have feedbacks, please notice me via email or in comment to this post. I'll appreciate you :)


Download Code Past Plugin (372 KB, MSI installer)

No comments: