nerdexam
Microsoft

98-372 · Question #8

Consider the following scenario. Allen has created a Windows Presentation Foundation (WPF) database application using .NET Framework 4.0. The application helps users keep track of their e-Book collect

The correct answer is A. As a setting with user scope. Allen's WPF database application will store the users' color choices as a setting with user scope. Indicating the scope as "user scope" allows the application to store different settings for each user of the program. Application settings provide a simple means to store applicatio

Understanding Cloud Concepts

Question

Consider the following scenario. Allen has created a Windows Presentation Foundation (WPF) database application using .NET Framework 4.0. The application helps users keep track of their e-Book collection. He identifies that some computers might have many users, such as two roommates might share a computer, with both individuals using the same application on the same computer to manage their e-Book collections. Allen sets up a database to handle many users without mixing up the collections. Allen has implemented a very trendy system that allows users to alter the colors, fonts, and graphics in the application, giving it a personalized look and feel. How will Allen's WPF database application store the users' color choices?

Options

  • AAs a setting with user scope
  • BAs a string in the source code
  • CAs a setting with machine scope
  • DAs a setting with application scope

How the community answered

(41 responses)
  • A
    73% (30)
  • B
    2% (1)
  • C
    15% (6)
  • D
    10% (4)

Explanation

Allen's WPF database application will store the users' color choices as a setting with user scope. Indicating the scope as "user scope" allows the application to store different settings for each user of the program. Application settings provide a simple means to store application-scoped and user-scoped settings on a client computer. Using Visual Studio, a setting is defined for a specified property by providing its name, data type, and application/user scope. Related settings can also be placed into named groups for easy use and readability. Once defined, these settings are persisted and read back into memory automatically at runtime. A pluggable architecture makes possible the persistence mechanism to be altered, but by default, the local file system is used. Application settings work by persisting data as XML to different configuration files (.config) related to whether the setting is application/user scoped. In most cases, the application- scoped settings are read-only, as they are program information that need not be overwritten. By contrast, user- scoped settings can be read and written safely at runtime, even if the application runs under Settings are stored as XML fragments in configuration files. Application-scoped settings are represented by the <application.Settings> element, and are located in app.exe.config, where app is the name of the main executable file. User-scoped settings are represented by the <userSettings> element and are located in user.config, where user is the username of the person presently running the application. The app.exe.config file must be deployed with the application. The settings architecture will create the user.config files on demand when the first time the application saves settings for that user. A <userSettings> block is defined inside app.exe.config to supply default values for user-scoped

Topics

#.NET Framework#application settings#user scope#WPF

Community Discussion

No community discussion yet for this question.

Full 98-372 Practice