All great things begin with small ones. I always thought this sentence was true. And so I started creating first component that will be part of free VizToolkit – a Visual Studio controls library. First what came in mind was creating control which can communicate with viz engine. It should use asynchronous communication model and be able to throw events when connection is established or lost. Second thing this control should do is providing simple way to receive response from viz machine. It should be simple to use as developer should only place it on the Form and set up number of parameters.

I spent few hours on writing helper classes and end up with following event argument:

public class VizConnectionEventArgs
{
    public readonly String RemoteHost;
    public readonly int RemotePort;
    public readonly SocketConnectionState ConnectionState;
    public readonly String VizResponse;
    public readonly String ResponseID;
    public readonly String ResponseValue;

   public VizConnectionEventArgs(String host, int port,
                                 SocketConnectionState state,
                                 String response);
}

This object will be passed with our controls connection events and OnVizResponse event. Note three members related to response from remote machine (VizResponse, ResponseID, ResponseValue). VizResponse will contain whole response text while ResponseID and ResponseValue contain viz-command request number and viz-response text. I think this feature might be quite usefull.

Once I designed basic architecture, creating first control was easy. To make it quicker to use I added custom SmartTags – Visual Studio 2005 feature which allows you to set some parameters without having to look them up in Properties Grid. Below you can have a small sneak pick on how it looks right now.

VizConnection control placed on a form with SmartTags opened

VizConnection control placed on a form with SmartTags opened

There is of course few functionalities I have to add to it, but basically this is it. Once I create another one I will publish first release of free VizToolkit.

GHTime Code(s): a210e