a common requirement in any team or framework. However, we usually reuse at
business logic or general infrastructure level. The User Interface reuse is
more difficult to achieve. CAB architecture is loosely coupled enough to make
following screenshots illustrates the bank teller quickstart application hosted
in Outlook, Word and a regular Winforms application.
lines of code [:)]
- Download the solution
the solution and build it. If you experience problems, check that
the references to the CAB assemblies are correct.
the shell and the CAB application
- Create a
new project to host the shell and the CAB application.
The shell in a regular CAB application would be a Form. However if we
want to host the application in a different executable (Outlook, Word, IE,
etc), we already have the container. So the Shell will be a UserControl.
references to CAB assemblies.
- Create a
regular UserControl and place the workspaces, menus, toolstrip, statusbar,
and everything related to the shell.
- If you
need to override the CAB events like AfterShellCreated or
AddBuilderStrategies, create a new class that derives from CompositeUIExtensions.Hosting.UserControlShellApplication where TUserControlShell is the type of the UserControl created on the previous step
and TWorkItem is the root work item that
must derives from UserControlWorkItem.
a CAB module/app from Outlook/Word/External application
- Open your
project and add references to CompositeUIExtensions.Hosting and the CAB assemblies. Also
copy the project related assemblies (module assemblies for example) to the
application output directory.
an instance of CompositeUIExtensions.Hosting.UserControlHost and add it to the
correspondent Controls collection. The following code illustrates how;
UserControlHost plugin =
â€¦Controls.Add( plugin );
the ProfileCatalog.xml, configure it with the desired module/s and set the
Build Action to CopyAlways.
the solution that shows how to host the BankTeller app inside Outlook, Word and