Experimenting with Live Writer and code plugins

I have a wordpress blog, but I find its text editor to be somewhat limiting. The big limitation I have found is the problem of pasting code into the blog, and making the code display nicely. So far I have had no success with wordpress plugins. So I’m going to experiment with Live Writer. So for my first experiment, I downloaded the “Paste As Visual Studio Code” plugin from Lavernock. There website link is here

So, here is some C# code with very little eye candy:

public class SymbolUseOptions
{
    public SymbolUseOptions()
    {
        // empty constructor
    }
    private FileReference mMethod;
    public FileReference Method
    {
        get { return mMethod; }
        set { mMethod = value; }
    }

    private FileReference mSymbol;
    public FileReference Symbol
    {
        get { return mSymbol; }
        set { mSymbol = value; }
    }
}

So that worked very easily.

Here is some C++ code (This time with line numbers and alternating line colors):

Code Snippet
  1. bool Database::Open( String^ file_name )
  2. {
  3.     bool result = false;
  4.     if (!mOpened)
  5.     {
  6.         const char* filename = Util::StringToChar(file_name);
  7.         UdbStatus status = UdbStatus::Udb_statusOkay;
  8.         
  9.         status = (UdbStatus)udbDbOpen( filename );
  10.         
  11.         Util::FreeNativeString(filename);
  12.  
  13.         Debug::Assert(status == UdbStatus::Udb_statusOkay);
  14.  
  15.         if (status == UdbStatus::Udb_statusOkay)
  16.         {
  17.             result = true;
  18.             mOpened = true;
  19.         }
  20.     }
  21.  
  22.     return result;
  23. }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s