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 Visual Studio 2010 and Microsoft .
NET Framework 4 to create a Windows Presentation Foundation (WPF) application.
You create a WPF window in the application.
You add the following code segment to the application.
public class ViewModel
{
public CollectionView Data { get; set; }
}
public class BusinessObject
{
public string Name { get; set; }
}
The DataContext property of the window is set to an instance of the ViewModel class.
The Data property of the ViewModel instance is initialized with a collection of BusinessObject objects.
You add a TextBox control to the Window.
You need to bind the Text property of the TextBox control to the Name property of the current item of the CollectionView of the DataContext object.
You also need to ensure that when a binding error occurs, the Text property of the TextBox control is set to N/A .
Which binding expression should you use?()
A. { Binding Path=Data/Name, FallbackValue='N/A' }
B. { Binding Path=Data.Name, FallbackValue='N/A' }
C. { Binding Path=Data/Name, TargetNullValue='N/A' }
D. { Binding Path=Data.Name, TargetNullValue='N/A' }
You create a Windows client application by using Windows Presentation Foundation (WPF).
The application contains the following code fragment.
You need to assign lbDetails to use the detail data template when btnDetails is clicked.
Which code segment should you write for the click event handler for btnDetails?()
A. lbDetails.ItemsPanel.FindName("detail",lbDetails);
B. var tmpl = (ControlTemplate)FindResource("detail"); lbDetails.Template = tmpl;
C. var tmpl = (DataTemplate)FindName("detail"); lbDetails.ItemTemplate = tmpl;
D. var tmpl = (DataTemplate)FindResource("detail"); lbDetails.ItemTemplate=tmpl;
You have definded a style in app.xaml
You want to use this style in your application in code behind.
How can you achieve this? ()
A. button1.Style = FindName("A") as Style
B. button1.Style = FindName("B") as Style
C. button1.Style = FindResource("A") as Style
D. button1.Style = FindResource("B") as Style
A. Dependency Property
B. INotifyPropertyChanged
C. net Property
A. WPF visualizer
B. in locals
C. WPF tree visualizer
Which of the following examples of the pack URI syntax accesses a file named myImage.jpg in a folder named MyFolder in another assembly named myAssembly? ()
A. Pack://application:,,,/myAssembly;component/MyFolder/myImage.jpg
B. Pack://application:,,,/myAssembly;MyFolder/component/myImage.jpg
C. Pack://application:,,,;component/myAssemby/MyFolder/myImage.jpg
D. Pack://application:,,,/myAssembly;component/myImage.jpg
You are developing a Windows Presentation Foundation (WPF) application. You need to use XAML to create a custom control that contains two Button controls.
From which base class should you inherit? ()
A. FrameworkElement
B. UIElement
C. UserControl
D. Button
You use Microsoft .Net Framework 4 to create a Windows Form application.
You created a new application, you then wrote the code below:
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture
Which of the following options are TRUE? ()
A. The user interface will make use of the currently configured culture settings in the Control Panel at present.
B. The user interface will make use of new culture settings.
C.The user interface will make use of the culture settings that were installed with the operating system.
最新试题
You upgrade a Windows Forms application to Microsoft .NET Framework 4. The application was developedby 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?()
Which of the following examples of the pack URI syntax accesses a file named myImage.jpg in a folder named MyFolder in another assembly named myAssembly? ()
You are developing a Windows Presentation Foundation (WPF) application. All of the application styles are in the file name Themes.dllYou have the followiing markup segment.BlueBackground is defined in a XAML file named BlueTheme.xaml. The XAML markup is compiled into the Themes.dll file.You need to ensure that the XAML file is referenced so that the application can apply the settings in the BlueBackground style.()
Where can you check the value of a dependency property? ()
You create a Windows client application by using Windows Presentation Foundation (WPF). The application contains the following code fragment. You need to assign lbDetails to use the detail data template when btnDetails is clicked. Which code segment should you write for the click event handler for btnDetails?()
You are developing a Windows Presentation Foundation (WPF) applicationThe application is for commercial use and requires a valid license key to be entered. You create a project type of Class Library code to validate license keysYou need to ensure that the user enters a valid license key during installation of the software.Which deployment should reference the class library?()
You are developing a user control for Windows Presentation Foundation (WPF) application.The user control contains a button. Both the user control and the hosting control must receive the button click event.You need to ensure that the user control responsd to the button click event before hosting control responds to the event.What should you do ?()
You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application has a window named MainWindow that has a StackPanel control named sp as the root element. You want to create a Button control that contains a TextBlock control with the "Save" Text property. You need to create the control dynamically and add the control to sp. Which code segment should you write in the constructor of the MainWindow class?()
You are developing a Windows Presentation Foundation (WPF) application that displays opportunities from List<T.. class named Lead. The Lead class contains the properties Title and Revenue.You add a DataGrid control named dgQualifiedLeads to the MainWindow.xaml file. You set the ItemsSource property to Leads as follows.You need to ensure that CollectionViewSource is used to filter the list to display only Lead objects with revenue ...What should you do ?()
You are developing WPF application for managing student information... btnSort and a DataGrid control named dgStudents on the design surface of the MainWindow.xaml properties : FirstName and LastName. You create the following code segment in the constructor of...The DataGrid control displays the list of students unsorted.You need to ensure that the list of students is sorted by last name.Which code segment should you add to the click event handler of the Button control?()