This assignment expands on the shapes hierarchy assignment.

Create a class library for your shapes classes. To do this you will need to create a new "Class Library" Visual Basic project. Move the code for the classes that you have created already into this project. This project should create a .dll file named MyShapes.dll.

A Class Library does not contain a Sub Main. Therefore, you should create a second Visual Basic Project to test your library. The second VB project should be a "Console Application". To use the classes in MyShapes.dll you will need to create a reference to the MyShapes.dll file. To do so, click the "Show All Files" button in the Solution Explorer window pane. Then right-click on "References" and add a refernce to the MyShapes.dll file.

When writing the Console Application you will find that it is necessary to preface all of the class names from the MyShapes library with "MyShapes." (without the quotes), e.g.:

    Dim l as MyShapes.Line = New MyShapes.Line(New MyShapes.Point(0,0), New MyShapes.Point(5,5))

To make it easier to write your code in the console application you can include the following line at the VERY TOP of the file that contains Sub Main:

    Imports MyShapes

If you do so then you will be able to use the names of the classes from MyShapes.dll without typing "MyShapes." every time. i.e. the line above could then be written as :

    Dim l as Line = New Line(New Point(0,0), New Point(5,5))