When creating type classes it can be useful to have an .Empty property so you know if an item has been populated. Its quite easy to achieve. All we do is create an instance of the class as a static property. Then we compare our instance to this one when we need to check.
Read more…
On a recent project I had to allow users to upload their memories. Memories are vague things and I had to enable users to upload and assign incomplete dates. They needed to be able to enter ‘The 90′s’ or ‘September 2000′ as well as complete dates ’1st Feb 2009′.
Read more…
Whilst working on the CMS I needed to be able to pass back the html a control will render when the user first adds it. The control doesn’t exist on the page yet as the sections are added via javascript. It was very easy to pass in StringWriter to the render function to get the html
Read more…
Been a bit quiet round here lately but not because I’ve not been working on it
I’ve been using it for a project at work and converting a lot of my stuff to be compatible with it. It’s running a site atm and doing well.
Alpha State
Mainly in alpha because things may yet change but the following all work
Read more…
Found this is microsoft official line on creating a singleton, much simpler than the normal GOF way
// .NET Singleton
sealed class Singleton
{
private Singleton() {}
public static readonly Singleton Instance = new Singleton();
}
In my cms’ I usually have the option of creating controls from the database. This is just a simple use for reflection but allows me to add controls to page just by adding a new row. If its one of my controls it supports a persistance system that allows the control to save and restore itself easily.
Read more…