Possible Duplicate:
Does C# have extension properties?
I have the following:
public static class EnumExt
{
public static string D2(this Enum key)
{
return Convert.ToInt32(key).ToString("D2");
}
}
Which I use like this:
PageType.ContentBlock.D2()
Where PageType is an Enum.
Is there a way I can do this so that D2 is a property and rather not a method? It doesn't seem to make much sense to me that I always have to put the () after D2 ?