Showing posts with label Microsoft. Show all posts
Showing posts with label Microsoft. Show all posts

Wednesday, October 3, 2007

Finally: A Code Snippet Plugin that Works!

 

I am new to blogging and am using Windows Live Writer (beta) and am really liking it. However, I did have an initial stumbling block: I could not easily post source code and get it to display properly.

I downloaded the Code Snippet Plugin for Windows Live Writer authored by Leo Vildosola and here is the best result I could obtain:

 

using System;
using DevExpress.XtraEditors;
using DevExpress.XtraEditors.ViewInfo;
 
namespace CustomSimpleButton {
 
 public class CustomButton : SimpleButton {
 
 public CustomButton() {
 this.TabStop = this.AllowFocus = false;
 }
 
 CustomButtonViewInfo m_customButtonViewInfo;
 
 protected override BaseStyleControlViewInfo CreateViewInfo() {
 if (m_customButtonViewInfo == null)
 m_customButtonViewInfo = new CustomButtonViewInfo(this);
 return m_customButtonViewInfo;
 }
 }
}

 

If it displays on this web page for you, the same as it does for me, all of my lines of code are shifted or justified left (it's hard to read) and it does not use the colors or formatting that I use in Visual Studio. It seems like a potentially decent plugin with some unusable flaws for me; although, other users do not seem to have the same justification problem I am experiencing. I wrote the author about my justification problem and have not received a response, so I moved on to look for something better...

 

I tried every plugin I could find for WLW ( Windows Live Writer ) and I could tire you by demonstrating that none of them would display properly. Either they lost the basic formatting similar to above, or they used hard-coded color schemes that were offensive to me, or something just not acceptable happened with each plugin I tried... and I tried every one available for download (approx. 5 to 8).

 

I did, however, find a clear winner and it was not a plugin for Windows Live Writer, it is a plugin for Visual Studio! It uses the formatting settings that I use in Visual Studio and is very simple to use. You tell me, does this second sample appear better to you?

 

Code Snippet

using System;

using DevExpress.XtraEditors;

using DevExpress.XtraEditors.ViewInfo;

 

namespace CustomSimpleButton {

 

    public class CustomButton : SimpleButton {

 

        public CustomButton() {

            this.TabStop = this.AllowFocus = false;

        }

 

        CustomButtonViewInfo m_customButtonViewInfo;

 

        protected override BaseStyleControlViewInfo CreateViewInfo() {

            if (m_customButtonViewInfo == null)

                m_customButtonViewInfo = new CustomButtonViewInfo(this);

            return m_customButtonViewInfo;

        }

    }

}

 

What is this magical plugin? It is CopySourceAsHTML written by Colin Coller and released by J.T. Leigh & Associates Inc.

Note: the Code Snippet box is my own wrapper and is not created as part of the plugin: the plugin just auto-creates wonderfully formatted code for the web.

The steps I take are simple:

I insert my Code Snippet template in Live Writer, I switch to Visual Studio and highlight my code, then I right-click and select CopyAsHTML from the context menu. I then switch back to Live Writer and place my mouse cursor in the Code Snippet box. The final step is choose Edit, Paste Special, and select the option, Keep Formatting. Wa La - it's done!

All of this is done with an easy to use WYSIWYG blog post editor: Windows Live Writer (beta) and the assistance of a very helpful plugin.

Thursday, September 27, 2007

Review: Windows Live Writer(Beta) & Windows Live Mail (Beta)

Well, I just started Blogging, so what's a better topic than my first experience using a Blog Editor?

I discovered that 'Windows Live Writer®' (Beta) had been released and decided to give it a try. While downloading/installing Live Writer, an option to choose other 'Widows Live' products was offered and I decided to include Live Mail as well (I have been using Outlook 2002 and its time I decided to try a newer version).

I should note that the download/install does appear to 'hang', but eventually does continue (about 3-5 minutes for me). I have  nice Comcast  Cable® connection and 3-5 minutes now seems like an eternity.

I was immediately impressed: Live Mail auto-discovered and imported my email AND my registered newsgroups. The password and user information for the newsgroups was imported as well, but I had to manually enter my username, password and email server settings for my email accounts. I was up an running in minutes.

 

Here is a screen shot of my newsgroups using Live Mail:

Windows-Live-Mail

The new Live Mail newsgroups is essentially the old (Outlook Express)with a prettier face: I have not noticed any new features regarding newsgroups. Perhaps there is something "under-the-hood", but I didn't notice any difference in functionality. I did like how it was imported automatically and I like how my email and newsgroups are integrated into one program.

I did; however, notice improvements for email. For example, the new Live Mail versus Outlook 2002 was recognizing spam and moving it to a junk folder automatically. I think I will keep using Live Mail and give a longer test. So far, I am happy.

 

Live Writer is what I am using to post this Blog and it was very easy to configure. A few wizard screens had me enter my Blog info and my account info (required to have permission to access the Blog). Within less than a minute Live writer downloaded my template and I was looking at a great WYSIWYG editor.

I am finding this editor (Live Writer) to be very easy to use and here is a screen shot:

 Windows-Live-Writer

Overall: I am happy with both products and will continue to use them. Live Writer truly is a WYSIWYG editor and I am very happy. I will certainly discover any problems over time, until then I will assume the best.

Nice job Microsoft!