Chapter 6: Creating Cover Designer Application


The Microsoft Office Visio 2003 ActiveX control, also known as Visio drawing control provides the functionality of the Visio application object model. As a result, you can embed the ActiveX control in the host applications developed using Visual Studio .NET 2003 and integrate the Visio user interface to create and work with interactive Visio drawings and shapes .

This chapter explains how to use Visio drawing control in a VB.NET application developed using Visual Studio .NET 2003. The Cover Designer application shows how to embed the Visio drawing control, how to trap the Visio events, and how to open and save Visio drawings.

Architecture of the Cover Designer Application

The Cover Designer application consists of two projects:

  • CoverDesigner

  • ImageInfoProvider

The CoverDesigner project allows an end user to work with the Visio drawing control hosted in the Cover Designer application window and design a cover, such as a cover for a music CD, using images. The Cover Designer application window provides various categories of images, such as music instruments and images related to information technology.

The ImageInfoProvider project creates a Web service that exposes a method to retrieve information for the image specified by an end user from the SQL server database. It retrieves information, such as the image id, image category, image description, and image source for the image specified by the end user.

Figure 6-1 shows the architecture of the Cover Designer application:

click to expand: this figure shows the interaction between different components of the cover designer application.
Figure 6-1: The Cover Designer Application Architecture

The CoverDesigner project consists of four files:

  • frmCoverDesigner.vb : Provides the Cover Designer application window that embeds the Visio drawing control.

  • VisioEvents.vb : Provides the VisioEvents class to trap Visio events that occur in the Cover Designer application window.

  • VisioMethods.vb : Provides the VisioMethods class that defines some utility methods to enable the end user to use the Visio drawing control in the Cover Designer application to draw images.

  • frmImageDetails.vb : Provides the ImageDetails class to provide information for the image selected in the Cover Designer window by the end user.

The ImageInfoProvider project consists of one file, ImageInfoService.asmx.vb, which creates the Web service. When the end user requests the information for an image, the ImageDetails class calls the ImageInfoService Web service, which in turn establishes a connection with SQL server to fetch the image information from the CoverDesigner database.

Figure 6-2 shows the class diagram for the Cover Designer application:

the figure shows the classes frmcoverdesigner, imagedetails, visioevents, and visiomethods used in the cover designer application.
Figure 6-2: The Class Diagram for the Cover Designer Application



NET InstantCode. UML with Visio and Visual Studio .NET
NET InstantCode. UML with Visio and Visual Studio .NET
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 49

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net