The Microsoft Composite UI Application Block (CAB) is a framework used for creating Model-View-Presenter style windows forms applications. The Smart Client Software Factory (SCSF) streamlines the process of creating these applications by providing us with a powerful base project and a set of menu options for quickly generating modules, views, and events in Visual Studio. Unfortunately, CAB only provides direct support for the common windows components included with Visual Studio. It is possible to develop your own support for third party components, but this can be a confusing and time consuming process. Lucky for us, Telerik noticed that there was a need for CAB support with it’s own controls. This resulted in the release of the Telerik CAB Enabling Kit (TCEK).
In addition to the product downloads page, the Telerik CAB Enabling Kit is available for download from CodePlex and includes the things we will need to get started with this tutorial. This blog post assumes you have a basic knowledge of CAB and have worked with it before. If you have not worked with CAB before, here are a few resources I recommend reading to help you get started. Once you have explored these resources, feel free to come back here and read the rest of this post.
White Paper - Designing Smart Clients Based on CAB and SCSF - This white paper contains an abundance of information about everything supported by CAB. It can be a little hard to grasp all of the concepts it describes, so don’t worry if you have a little trouble, eventually it will come to you.
Rich Newman's Introduction to CAB/SCSF - After working with CAB for over a year, I still had several unanswered questions about why certain things work the way they do. This guide cleared up several of those questions for me.
That being said, I would like to get you started with the TCEK through a series of blog posts I will be making over the next few weeks. Learning any technology can be a little confusing, especially CAB, so I hope this makes the process a little easier for you. Lets get started!
This tutorial will explain the setup process for a CAB project based on the TCEK. This setup is required for using the Telerik WinForms components with CAB specific functionality such as Commands and UIExtensionSites.
My CAB setup is as follows. If you notice any discrepancies between your setup and the way I’ve written this tutorial, you may be using different versions of these tools/libraries.
Visual Studio 2008 SP1
Microsoft Enterprise Library 4.1 - October 2008
Microsoft Guidance Automation Extensions - February 2008
Composite UI Application Block - December 2005
Smart Client Software Factory - April 2008
RadControls for WinForms - 2009.2.729
TCEK Cab Installation Package - 2009.2.701
In this section, you will learn how to add the TCEK project to a newly created Smart Client Application.
Note: I ran into a slight problem here most likely based on my system’s configuration. When running the program, I received a ModuleLoadException claiming that Infrastructure.Layout.dll was not found. This problem is easily fixed by modifying profilecatalog.xml. My project’s assembly files were improperly referenced here for some reason. Changing the references Infrastructure.Layout.dll, and Infrastructure.Module.dll to CABExample1.Infrastructure.Layout.dll and CABExample1.Infrastructure.Module.dll respectively solved the problem.
Once the project is created, you will need to complete a few steps to convert it into a TCEK based CAB Application.
// Original Version
public
abstract
class
SmartClientApplication<TWorkItem, TShell> : FormShellApplication<TWorkItem, TShell>
// TCEK Version
public
abstract
class
SmartClientApplication<TWorkItem, TShell> : RadFormShellApplication<TWorkItem, TShell>
Click here to download the source code used in this post.