Blog

Implementing IBindingListView... or not

Sometimes, it is very difficult to reuse existing code.

Today I wanted to code a class implementing the IBindingListView. At first, I wanted to inherit the BindingList but then I discovered that some features were hidden, such as the AddIndex. This method is not virtual and does not delegate to an AddIndexCore method either.

Read more

Adding Design Time support to the ServingNestedContainer

The ServingNestedContainer is fine but it does not support DesignTime. Therefore, if you want to still be able to benefit from the productivity improvement of the designer, you have to re-site your components.

Fortunately, it is possible to implement a component that would, through its Designer, register a CodeDomProvider that overrides the CodeDomProvider in charge of initializing of the components field.

Read more

Unleashing the wonders of the Component model

One of the things that made me like the .Net framework so much was the component model, along with the design time support.

At first sight, a Component looks like a stand alone piece of code you can parametrize and use in your own code. The easiest way to do so is to create a component derived class and to drop components on it. Then, the design time mechanism quicks in and you can use the PropertyGrid to set the properties and register the event listeners.

Read more

3 simple JobDispatcher

In a previous post, I implemented a JobDispatcher using a queue and a BackgroundWorker. There are 3 simple JobDispatcher I'd like to implement now:

a NullJobDispatcher, that, basically does nothing, a SynchronousJobDispatcher, that execute the job when it is dispatched, a ReactorJobDispatcher, that uses the ThreadPool.

Read more

Time *not* to refactor the JobDispatcher class

The JobDispatcher has to tasks to perform: keeping track of the dispatched jobs and executing them.

So, at one point, Marc and I discussed about adding a virtual Execute(IJob job) method that would Execute the job. This way, inheritors could add tracking or exception handling.

Read more