Ensurepass


QUESTION 131

You are developing a utility screen for a new client application. The utility screen displays a thermometer that conveys the current status of processes being carried out by the application. You need to draw a rectangle on the screen to serve as the background of the thermometer as shown in the exhibit.

clip_image001

The rectangle must be filled with gradient shading. (Click the Exhibit button.) Which code segment should you choose?

A. RectangleF rectangle = new RectangleF(10f, 10f, 450f, 25f); SolidBrush rectangleBrush = new SolidBrush(Color.AliceBlue); Pen rectanglePen = new Pen (rectangleBrush);

Graphics g = this.CreateGraphics(); DrawRectangle(rectangleBrush, rectangle);

B. Rectangle rectangle = new Rectangle(10, 10, 450, 25); LinearGradientBrush rectangleBrush =

new LinearGradientBrush(rectangle, Color.AliceBlue, Color.CornflowerBlue, LinearGradientMode. ForwardDiagonal);

Pen rectanglePen = new Pen(rectangleBrush); Graphics g = this.CreateGraphics(); DrawRectangle(rectanglePen, rectangle);

C. RectangleF rectangle = new RectangleF(10f, 10f, 450f, 25f); Point[] points = new Point[] {new Point(0, 0), new Point(110, 145)};

LinearGradientBrush rectangleBrush =

new LinearGradientBrush(rectangle, Color.AliceBlue, Color.CornflowerBlue, LinearGradientMode. ForwardDiagonal);

Pen rectanglePen = new Pen(rectangleBrush); Graphics g = this.CreateGraphics(); DrawPolygon(rectanglePen, points);

D. Rectangle rectangle = new Rectangle(10, 10, 450, 25); LinearGradientBrush rectangleBrush =

new LinearGradientBrush(rectangle, Color.AliceBlue,Color.CornflowerBlue,LinearGradientMode. ForwardDiagonal);

Pen rectanglePen = new Pen(rectangleBrush); Graphics g = this.CreateGraphics(); FillRectangle(rectangleBrush, rectangle);

Correct Answer: D


QUESTION 132

You need to ensure that, for each exception, the central logging system logs the name of the method that caused the exception.

Which code segment should you insert at line AS12 in the ApplicationServices.cs file?

A. string source = ex.StackTrace(0).ToString();

B. string source = ex.TargetSite.MethodHandle.Value.ToString();

C. string source = ex.Data("ExceptionSource").ToString();

D. string source = ex.TargetSite.Name;

Correct Answer: A


QUESTION 133

The order-processing service must save submitted orders in a format that persists all properties on the Order object.

You need to serialize Order objects.

Which code segment should you insert at line OR22 in the OrderRepository.cs file?

A. BinaryFormatter formatter = new BinaryFormatter(); MemoryStream storeStream = new MemoryStream(); formatter.Serialize(storeStream, order)

B. XmlSerializer serializer = new XmlSerializer( GetType (Order), Assembly.GetExecutingAssembly().

GetTypes());

MemoryStream storeStream = new MemoryStream(); serializer.Serialize(storeStream, order);

C. XmlSerializer serializer = new XmlSerializer( GetType (Order)); MemoryStream storeStream = new MemoryStream(); serializer.Serialize(storeStream, order);

D. BinaryFormatter formatter = new BinaryFormatter(New SurrogateSelector(), new StreamingContext (StreamingContextStates.Persistence));

MemoryStream storeStream = new MemoryStream(); formatter.Serialize(storeStream, order);

Correct Answer: B


QUESTION 134

You are creating a class that uses unmanaged resources. This class maintains references to managed resources on other objects. You need to ensure that users of this class can explicitly release resources when the class instance ceases to be needed. Which three actions should you perform? (Each correct answer presents part of the solution. Choose three.)

A. Define the class such that it inherits from the WeakReference class.

B. Define the class such that it implements the IDisposable interface.

C. Create a class destructor that calls methods on other objects to release the managed resources.

D. Create a class destructor that releases the unmanaged resources.

E. Create a Dispose method that calls System.GC.Collect to force garbage collection.

F. Create a Dispose method that releases unmanaged resources and calls methods on other objects to release the managed resources.

Correct Answer: BDF


QUESTION 135

You are testing a method that examines a running process. This method returns an ArrayList containing the name and full path of all modules that are loaded by the process. You need to list the modules loaded by a process named C:TestAppsProcess1.exe. Which code segment should you use?

A. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules;

procs = Process.GetProcesses(@"Process1"); if (procs.Length > 0)

{

modules = porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.ModuleName);

}

}

B. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules;

procs = Process.GetProcesses(@"C:TestAppsProcess1.exe"); if (procs.Length > 0)

{

modules =porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.ModuleName);

}

}

C. ArrayList ar = new ArrayList(); Process[] procs; ProcessModuleCollection modules;

procs = Process.GetProcessesByName(@"Process1"); if (procs.Length > 0)

{

modules = porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.FileName);

}

}

D. ArrayList ar = new ArrayList();Process[] procs;

ProcessModuleCollection modules;procs = Process.GetProcessesByName(@"C:TestAppsProcess1. exe");

if (procs.Length > 0)

{

modules = porcs[0].Modules;

foreach (ProcessModule mod in modules)

{

ar.Add(mod.FileName);

}

}

Correct Answer: C


QUESTION 136

You are developing an application to assist the user in conducting electronic surveys. The survey consists of 25 true-or-false
QUESTION s. You need to perform the following tasks:

稩nitialize each answer to true.

Á®≠inimize the amount of memory used by each survey.

Which storage option should you choose?

A. BitVector32 answers = new BitVector32(1);

B. BitVector32 answers = new BitVector32(-1);

C. BitArray answers = new BitArray(1);

D. BitArray answers = new BitArray(-1);

Correct Answer: B


QUESTION 137

You are working on a debug build of an application. You need to find the line of code that caused an exception to be thrown. Which property of the Exception class should you use to achieve this goal?

A. Data

B. Message

C. StackTrace

D. Source

Correct Answer: C


QUESTION 138

What kind of object does the generic Dictionary enumerator return?

A. Object

B. Generic KeyValuePairt object

C. Key

D. Value

Correct Answer: B


QUESTION 139

Which methods allow COM components to be used in .NET applications? (Choose all that applay.)

A. Add a reference to the component throudh Microsoft Visual Studio 2005.

B. Use the type Library Import tool (TlbImport.exe).

C. Use the Regsvr32 tool.

D. Ensure thet the application is registered, using the RegSvr tool if necessary. Then either add a reference to it from the COM tab of the Add Reference dialog

box or use TblIpm.exe.

Correct Answer: ABD


QUESTION 140

You create a service application that monitors free space on a hard disk drive.

You must ensure that the service application runs in the background and monitors the .

What should you do? To answer, you need to move the three appropriate actions from the list of actions to the answer area and arrange them in the correct order.

Select and Place:

clip_image002

Correct Answer:

clip_image003

 

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

Comments are closed.