August 2006 - Posts - Peter's Software House

August 2006 - Posts

Simple CMS

Wow a really nice simple content management system by C. Brendan Enrick

"Simple CMS is an ASP.NET plug-in which can be added to any ASP.NET website with Atlas and the Atlas control toolkit installed. To install Simple CMS requires no code, no recompile, and a few added entries in web.config. It allows web administrators to quickly and easily add content to their webpages. This content is tied to masterpages and all of the managed content can be tied to themes."

Also have a look at the Cache Manager

"Cache Manager is an ASP.NET plug-in which can be added to any ASP.NET website with no code, no recompile, a single DLL, and a single entry in web.config. It allows web administrators to monitor and manage the ASP.NET Cache object for their ASP.NET applications."

Very nice!

Posted by Pieter | with no comments

My Tools

I use several tools on a daily basis:

Free Tools:

Notepad2
Fantastic replacement for Notepad.

Notepad++
Another Notepad replacement that I use when opening a lot of text files as it uses a tabbed interface.

ClipX
A little clipboard history manager.

ClipPath
Get the full path of a file copied to the clipboard.

Paint.NET
A free replacement for Paint that does pretty much all the basic image editing you will ever need.

DXCore
IDE integration framework that Refactor! and CodeRush is build on.

Reflector for .NET
The tool no .NET developer can go without!
Have a look at all the fantastic add-ins.

TortoiseCVS
CVS Client. Yea I know everyone and his dog is using subversion, but I have gigs of stuff in CVS and no time to convert to SVN at the moment, and besides it is working 100% for me, so why change something that ain't broken. ;)

WinMerge
My merge tool of choice, also integrated with TortoiseCVS.

The Regulator and Regulazy
Two fantastic tools from Roy Osherove.

SysInternals
A whole host of tools, Process Explorer, FileMon, RegMon etc...

Commercial:

Refactor!
My refactoring tool of choice.

CodeRush
Visual Studio productivity addin.

Posted by Pieter | with no comments
Filed under:

IE7 RC1 for WinXP SP2

Ok for those that don't speak TLA, the title is "Internet Explorer 7 Release Candidate 1 for Windows XP Service Pack 2".

Any case, it is available for download here.

Posted by Pieter | with no comments
Filed under:

DevExpress 6.2.2

DevExpress has just released V2006 vol 2 and it rocks!!!

Go and have a look at:

-- New components
http://www.devexpress.com/products/net/dxperienceent/whatsnew2006v2/newlibraries.xml

-- Major product updates
http://www.devexpress.com/products/net/dxperienceent/whatsnew2006v2/MajorUpdates.xml

-- Minor product updates
http://www.devexpress.com/products/net/dxperienceent/whatsnew2006v2/MinorUpdates.xml

 

Highlights for me is the support of PDF printing and the new Office 2007 Style Ribbon Interface.

Posted by Pieter | with no comments
Filed under:

SyntaxColor4Writer

Found this cool little add-in for Windows Live Writer.


SyntaxColor4Writer is a plugin for Windows Live Writer that enables you to embed syntax highlighting in your blog posts. This plugin uses an excellent component called Code Highlighter from Actipro Software. The following syntax languages are included and can be customized and extended:

  • BatchFile
  • C#
  • CSS
  • HTML
  • INIFile
  • Java
  • JScript
  • Perl
  • PHP
  • Python
  • SQL
  • VB.NET
  • Subscript
  • XML
Posted by Pieter | with no comments
Filed under:

Object is currently in use elsewhere.

I had an issue with the DevExpress LayoutControl, it kept on giving me an InvalidOperationException when I closed my forms.  My solution was to make sure that all my controls got disposed in the Dispose method of my UserControls.  Here is the code

 

        protected override void Dispose(bool disposing)

        {

            if (disposing)

            {

                foreach (Control control in this.Controls)

                {

                    IDisposable disposable = control as IDisposable;

                    if (disposable != null)

                    {

                        disposable.Dispose();

                    }

                }

                if (components != null)

                    components.Dispose();

            }

            base.Dispose(disposing);

        }

Posted by Pieter | with no comments

First Post from Windows Live Writer

Not bad at all.

Installation and setup was relatively painless.

    [TestFixture]

    public class TestContactList

    {

        MockRepository mocks;

 

        [SetUp]

        public void Setup()

        {

            mocks = new MockRepository();

        }

 

        [TearDown]

        public void TearDown()

        {

            mocks.VerifyAll();

        }

    }

 

Code posts seems to work much better than writely.

Posted by Pieter | 2 comment(s)

Create Control that implements BeginUpdate and EndUpdate

I needed a Control that implemented the same functionality as controls like the TreeView and ListView where you can call BeginUpdate and EndUpdate when you want to do an operation that repaints the control several times and cause flickering. So first thing I did was whip out Reflector and had a look at the TreeView.BeginUpdate(). It called Control.BeginUpdateInternal(), but this was an internal method and I did not want to invode reflection to get to it so I had a look at the code and came up with this.

Added the UnsafeNativeMethods class to call SendMessage:

[SuppressUnmanagedCodeSecurity]

internal static class UnsafeNativeMethods

{

public const int WM_SETREDRAW = 0xB;

[DllImport("user32.dll", CharSet = CharSet.Auto)]

public static extern IntPtr SendMessage(HandleRef hWnd, int msg, int wParam, int lParam);

}

Then I added this code to my UserControl and presto I had BeginUpdate and EndUpdate.

#region BeginUpdate And EndUpdate Added in UserControl

internal IntPtr SendMessage(int msg, int wparam, int lparam)

{

return UnsafeNativeMethods.SendMessage(new HandleRef(this, this.Handle), msg, wparam, lparam);

}

private short updateCount;

public void BeginUpdate()

{

if (this.IsHandleCreated)

{

if (this.updateCount == 0)

{

this.SendMessage(UnsafeNativeMethods.WM_SETREDRAW, 0, 0);

}

this.updateCount = (short)(this.updateCount + 1);

}

}

public void EndUpdate()

{

this.EndUpdate(true);

}

internal void EndUpdate(bool invalidate)

{

if (this.updateCount

{

return;

}

this.updateCount = (short)(this.updateCount - 1);

if (this.updateCount == 0)

{

this.SendMessage(UnsafeNativeMethods.WM_SETREDRAW, -1, 0);

if (invalidate)

{

this.Invalidate(true);

}

}

return;

}

#endregion

If you compare EndUpdate to the code in Control.EndUpdateInternal() you will see that I changed this.Invalidate() to this.Invalidate(true) so that all the child controls are also repainted.

Posted by Pieter | with no comments

Visual Studio AddIn on a Network Share

If you are like me and have your 'My Documents' on a Network share then you should have already had problems when trying to install a Visual Studio AddIn that insists on being installed in the "My DocumentsVisual Studio 2005Addins path". The easiest solution I have found was just to copy the *.AddIn file and any needed *.dll files to "C:Documents and SettingsApplication DataMicrosoftMSEnvSharedAddins" and then just change any tags to point to the correct path. For example have a look at GhostIt, C:Program FilesWeigeltGhostDoc for VS2005Weigelt.GhostDoc.Addin.dll, one of the better behaved AddIns.
Posted by Pieter | with no comments