单项选择题
You use Microsoft .NET Framework 4 to create a Windows Forms application.
You write the following code segment. (Line numbers are included for reference only.)
01sealed class FormSettings :
You need to ensure that the first time each user opens the application, a text field displays the following message: "Please enter your setting."
Which code segment should you insert at line 03?()
A. [UserScopedSetting()] [DefaultSettingValue("Please enter your setting.")]
B. [UserScopedSetting()] [SettingsDescription("Description: Please enter your setting.")]
C. [ApplicationScopedSetting()] [DefaultSettingValue("Please enter your setting.")]
D. [ApplicationScopedSetting()] [SettingsDescription("Description: Please enter your setting.")]
相关考题
-
单项选择题
You upgrade a Windows Forms application to Microsoft .NET Framework 4. The application was developed by using a previous version of the .NET Framework. The application uses the Code Access Security (CAS) policy for file access. When the application is executed, you receive the following exception: "NotSupportedException: This method uses CAS policy, which has been obsoleted by the .NET Framework." You need to resolve the error. What should you do?()
A.
B.
C.
D. -
单项选择题
You use Microsoft .NET Framework 4 to create a Windows Forms application. You plan to use a Windows Presentation Foundation (WPF) control of the UserControl1 type hosted in an ElementHost control named elementHost1. You write the following code segment. (Line numbers are included for reference only.) You need to ensure that the application changes the background color of the hosted control when the background color of the form changes. Which code segment should you insert at line 05?()
A. elementHost1.PropertyMap.Remove("BackColor"); elementHost1.PropertyMap.Add("BackColor", new PropertyTranslator(OnBackColorChange));
B. elementHost1.PropertyMap.Remove("Background"); elementHost1.PropertyMap.Add("Background", new PropertyTranslator(OnBackColorChange));
C. elementHost1.PropertyMap.Add("BackColor", new PropertyTranslator(OnBackColorChange)); elementHost1.PropertyMap.Apply("BackColor");
D. elementHost1.PropertyMap.Add("Background", new PropertyTranslator(OnBackColorChange)); elementHost1.PropertyMap.Apply("Background"); -
多项选择题
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. You write the following code segment. (Line numbers are included for reference only.) the TextBox control is data-bound to an instance of the Contact class. You need to ensure that the Contact class contains a business rule to ensure that the ContactName property is not empty or NULL. You also need to ensure that the TextBox control validates the input data. Which two actions should you perform?()
A.
B.
C.
D.
E.
F.
