Send As SMS

Sunday, November 06, 2005

Visual Studio 2005 - first days

VS.NET 2005 - first days

Finally, I found some time to install and check what is VS.NET 2005 (Beta 2). Actualy, it is not so new as I expected. For example, our company already hase similar Master/Detail library for ASP.NET. Also for many of areas we already have internal know hows and time will show, what is better - our internal solution or solution from Microsoft.

What is really sad, that such feature like Generics require additional installtion - this is most interesting thing for me. For now I am not able to install it - going to try again in few days.

In meanwhile, I'm playing with Web Parts.

Enums upgraded

I noticed a good technique used to provide exandable enum. In dotnet 1.1, it ws very frustrating for me that a user of compinent could not add a enumeration member.

In class WebPartManager, property DisplayMode we can see another possibility for predefined choices.

WebPartDisplayMode is class without public constructor, which can be derived.

You can make a selection from predefined members using parent class - WebPartManager, and it contains:

WebPartManager.BrowseDisplayMode;
WebPartManager.CatalogDisplayMode;
WebPartManager.ConnectDisplayMode;
WebPartManager.DesignDisplayMode;
WebPartManager.EditDisplayMode;
So, we have predefined set of constants checked at compile time, and a possibility to increase this set of possible members in derived class.

Possible implementations

This classes should have some private random variable, which allow them to answer if it is qual to another instance. For example, it could be Guid.NewGuid, or simple GetHashcode(), or maybe best choice will be localized Name of this instance.

Possible additional features

Also, by using class, we able to to add extra options to be customizable - for example, Localized name, Behavior parameters (for stream - not only buffered, but also a buffer size), etc.

Those properties could be both readonly or not. (If not - it will be handy to implement Clone() method - not always needed to change behaviour for all system.



Applies to all dotnet languages: C#, VB.NET, C++.NET, J#