Of course, we will add settings to the Library Project in this chapter, but we'll also go back and start to use some of those settings in code that we previously entered as hardcoded values.
I really struggled over whether to use application-scoped or user-scoped configuration values for some of the rarely changing settings, such as the database connection string. I finally decided on the user area so that they could be modified through the features of the program. Application-scoped settings are read-only and can only be updated outside the program, so that idea is out. The expectation with application-scoped settings is that the system administrator will manage them, either by using Notepad on the XML file, or through some custom administrative tool. Since we aren't going to take the time in this book's project to write a separate administration tool, we'll keep everything at the user level and allow modification through the main Library program.
Load the Chapter 14 (Before) Code project, either through the New Project templates or by accessing the project directly from the installation directory. To see the code in its final form, load Chapter 14 (After) Code instead.
Let's document the settings used by the application in the project's Resource Kit. Add the following content to the Resource Kit word processing file.
The Library Project uses Visual Basic's settings system to track user-specific state values maintained ...