COP4226, Extra Credit 5
Due Sunday, 12/1 (late 6am 12/2).
Zip your entire project and upload on the web. Exclude the
Debug and Release directories.
Submitting
Homework Online.
This project will search the local hard drive for text files. The names of text files
will be added to a list box. The details of the text files will be displayed in a grid
view. Changing the current item will change the item in the other control, too.
A file can be double-clicked in the list view and the file will be opened in a dialog
that uses a rich text box to show the contents of the file.
Data Class
Create a data class that represents a file name.
- The class will have the following public properties: name, path, date modified, extension
- Add private members as needed.
- Do not expose implementation details to any other classes
Document Class
Create a document class that contains a generic list of the data class.
- Add other properties and methods as needed.
- Additional methods should be added to encapsulate access to the document
class.
- Do not expose any implementation details to other classes.
Main Class
Define a user interface that has three panels separated by splitters.
- Top Panel
-
- The top panel should extend across the entire client area.
- Add a combo box with drop down style of drop down list, that contains the extensions that can be searched for: txt, html, rtf.
- Add buttons to the panel for starting, stopping, pausing the search for file names.
- Left Panel
-
- The left panel should be below the top panel and take up the left side of the remaining area
- Add a list box that will contain the names of files that have been found. The list box should fill the panel.
- Right Panel
-
- The right panel should be below the top panel and take up the remaining area not covered by the top and left panels.
- Add a grid view with the information for files that have been found. The grid view should fill the panel.
Change the cursor for the list box and grid view to an animated cursor. Use a different cursor for each.
Search for all files with specific extension on the current computer.
- Implement the buttons for starting, stopping and pausing the search.
- The application should open with the search stopped.
- If the search has been paused, one of the buttons should be able to unpause it, without starting the search over again.
- Find all files with the extension selected from the drop down
list.
- If the drop down list is changed during the search, then the file
extension that the search is seeking will also change.
- I have provided a text file with
methods that will search your hard drive for .txt files.
- You will need to modify the code for different
extensions.
- You will need to modify the code to work in a thread.
- You will need to test for cancellation and pause at several
places, to guarantee a fast response to the command.
- Every time files are found in a directory, add the full path of each
file to the list box.
- Double-clicking the name in the list box should open a modeless dialog with a rich text box containing the text from the file.
- When the current item in the list box changes, the grid view should also change to that item, and vice versa. Use complex data binding.
- If the dialog is closed before the search ends, be sure that the
search is cancelled before the dialog closes.
- When the search is complete or cancelled, display a message box stating how many
files were found.
- Use a BackgroundWorker.