COP4226, Homework 4

Due Monday, 11/30

Avoid long methods. Each method that you create should be short, to promote encapsulation. If you have a method that is longer than 25 lines, then it probably needs to be divided into smaller methods.

Multi-SDI Application

This application will be an example of a Multiple - Single Document Interface (Multi-SDI) application. It will create a better notepad that can open multiple windows. The improved notepad will also look for prime numbers. Perhaps the name for the application should be NotePrime.

Be sure that I cannot crash your program. This means that you will need to implement validation appropriately. Do not swallow exceptions! If something goes wrong, be sure that the appropriate exception is thrown.

Be sure that dialogs open in appropriate places. Use docking, anchoring, splitting, minimum and maximum sizes to control the appearance of your application. Use your base classes and user controls from previous homeworks to improve the appearance of your application.

Under no circumstances should any child form access any part of a parent. Use interfaces appropriately.

Implement encapsulation. Separate the view from the document.

Under no circumstances may a thread change a variable that is not local to the thread. The thread may not change parameters.

Application Context

Use the Visual Basic application context.

Prime Thread

Allow an additional thread in the application that calculates prime numbers.

Main Application

The main application will handle editing of the document. Just handle plain text. Do not do anything special for rich text.

The main interface is for a text editor.

Allow printing and print preview of the document.

Allow print preview of all the documents by the application context.

Each open document should be able to start, stop, pause the thread. You may place these controls in the modeless dialog for the thread. The form only has to be able to open the modeless dialog. It does not need individual buttons for the thread.

Each open document should be able to open a modeless dialog that shows all the primes that have been found.

  • The thread may only change a variable that it created. The thread may not change parameters.
  • Allow serialization and deserialization of all found primes.