Ensurepass

QUESTION 61

You use Microsoft .NET Framework 4 to create a Windows Forms application.

You have a DataGridViewthat is bound to a DataTablecontaining a column named ProductName. The ProductNamecolumn can contain any valid string, except “ProductX,” “ProductY,” “ProductZ.” You need to ensure that only valid entries for ProductNameare saved when users edit the DataGridView. Which

DataGridViewevent should you use?

 

A.    CellBeginEdit

B.    Invalidated

C.    Validated

D.    Validating

 

Correct Answer: D

 

 

QUESTION 62

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

The application contains three text boxes named txtAddress, txtCity, and txtState. You need to ensure that the postal code is automatically set based on the information typed by users in the text boxes. You also need to ensure that the complete address is displayed in a TextBlockcontrol. Which code fragment should you use?

 

A.    clip_image002

B.    clip_image004

C.    clip_image006

clip_image008clip_image010

D.     

 

Correct Answer: C

 

 

QUESTION 63

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

The application contains an ObservableCollectionobject named Pictures that contains several Picture objects. Each Pictureobject contains the Name and PictureFilePathproperties. You add a ListBoxcontrol to the application. You need to ensure that the pictures are displayed in the ListBox control.

Which code fragment should you use?

 

A.    clip_image012

B.    clip_image014

C.    clip_image016

D.    clip_image018     

 

Correct Answer: D

 

 

QUESTION 64

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

You declare a class named PictureContainerthat has a property named Photo. The Photo property is of the byte[]type and contains an image in the JPEG format. You assign a collection of the PictureContainerelements to the current DataContext. You need to create a ListBox control that displays the images. Which code fragment should you use?

 

A.    clip_image020

B.    clip_image022

C.    clip_image024

D.    clip_image026

 

Correct Answer: C

 

 

QUESTION 65

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

You create a class named Personthat has a FirstName property and a LastNameproperty. You create a resource that contains a collection of Personobjects

and assign the family key to it. You add a ListBoxcontrol by using the following code fragment. (Line numbers are included for reference only.)

clip_image028

You need to ensure that each item in the ListBoxcontrol meets the following requirements:

·         Contains a TextBox that is data-bound to the FirstName property.

·         Contains a TextBox that is data-bound to the LastName property.

Which code fragment should you insert at line 04?

 

A.            <TextBox Text=”{Binding FirstName}” />

<TextBox Text=”{Binding LastName}” />

 

B.            <TextBox Text=”{Binding Path=FirstName, Source=DataItem}” />

<TextBox Text=”{Binding Path=LastName, Source=DataItem}” />

 

C.            <TextBox Text=”{Binding DataItem.FirstName}” />

<TextBox Text=”{Binding DataItem.LastName}” />

 

D.            <TextBox Text=”{PriorityBinding StringFormat=FirstName}” />

<TextBox Text=”{PriorityBinding StringFormat=LastName}” />

 

Correct Answer: A

 

 

QUESTION 66

You use Microsoft Visual Studio 2010 and Microsoft .NET Framework 4 to create an application.

The application uses the LINQ ParallelEnumerable. AsParallel method to perform multiple queries on a database. You need to ensure that queries can execute on separate threads concurrently. What should you do?

 

A.    Use the AsOrderedmethod.

B.    Use the SelectManymethod.

C.    Use the AutoBufferedoption in the WithMergeOptionsmethod.

D.    Use the WithExecutionModemethod with the ParallelExecutionMode.ForceParallelismparameter.

 

Correct Answer: D

 

 

QUESTION 67

You use Microsoft .NET Framework 4 to create an application.

The application performs resource-intensive calculations that consist of multiple layers of nested looping. The application will be deployed to servers that contain

varying hardware configurations. You need to ensure that the application utilizes CPU resources on the server in the most efficient manner. You want to achieve this goal by using the minimum amount of code. What should you do?

 

A.    Use multiple System.Threading.Threadobjects.

B.    Use the background worker process (BWP).

C.    Use the Thread.BeginInvokemethod.

D.    Use the Parallel.Formethod.

 

Correct Answer: D

 

QUESTION 68

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application. The application uses the background worker process (BWP). When the user clicks a button,

·         the background worker executes a method named DoCalculationsasynchronously.

·         You need to implement a progress bar on the user interface (UI) that informs the user of the progress of DoCalculations.

Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)

 

A.    Modify the Value property of the progress bar in DoCalculations.

B.    Modify the Value property of the progress bar in the ProgressChangedevent handler of the background worker.

C.    Modify the Value property of the progress bar in the RunWorkerCompletedevent handler of the background worker.

D.    Call the ReportProgressmethod of the background worker in DoCalculations.

E.    Call the ReportProgressmethod of the background worker in the DoWorkevent handler of the background worker.

 

Correct Answer: BD

 

 

QUESTION 69

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

You want to localize the application to use the German locale settings. You need to allow the ResourceManager class to retrieve a neutral German locale version of the text to be displayed in the user interface (UI). Which file should you add to the project?

 

A.    Resources.de.xml

B.    Resources.de-DE.xml

C.    Resources.de.resx

D.    Resources.de-DE.resx

 

Correct Answer: C

 

 

QUESTION 70

You use Microsoft .NET Framework 4 to create a Windows Presentation Foundation (WPF) application.

The application uses the drag-and-drop functionality. You need to ensure that the drag-and-drop operation is stopped when a user moves the cursor outside the boundaries of the application form. Which enumeration member should you use?

 

A.    DragAction.Cancel

B.    DragAction.Drop

C.    DragDropEffects.None

D.    DragDropEffects.All

Correct Answer: A

 

Download Latest MCTS 70-511 Real Free Tests , help you to pass exam 100%.

Comments are closed.