You are developing a custom event handler to automatically print all open documents. The event handler helps specify the number of copies to be printed. You need to develop a custom event arguments class to pass as a
parameter to the event handler.
Which code segment should you use?
You use Reflection to obtain information about a method named MyMethod. You need to ascertain whether MyMethod is accessible to a derived class. What should you do?
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?
You are testing a newly developed method named PersistToDB. This method accepts a parameter of type EventLogEntry. This method does not return a value. You need to create a code segment that helps you to test
the method. The code segment must read entries from the application log of local computers and then pass the entries on to the PersistToDB method. The code block must pass only events of type Error or Warning from the
source MySource to the PersistToDB method.
Which code segment should you use?
Your application uses two threads, named thread One and thread Two. You need to modify the code to prevent the execution of thread One until thread Two completes execution.
What should you do?
You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You need to ensure that the dictionary is type safe. Which code segment should you use?
You are creating an assembly named Assembly1. Assembly1 contains a public method. The global cache contains a second assembly named Assembly2. You must ensure that the public method is only called from
Assembly2. Which permission class should you use?
You create an application to send a message by e-mail. An SMTP server is available on the local subnet. The SMTP server is named smtp.contoso.com.
To test the application, you use a source address, me@contoso.com, and a target address, you@contoso.com.
You need to transmit the e-mail message.
Which code segment should you use?
You are developing a custom-collection class. You need to create a method in your class. You need to ensure that the method you create in your class returns a type that is compatible with the Foreach statement. Which criterion should the method meet?
You are developing an application to perform mathematical calculations. You develop a class named CalculationValues. You write a procedure named PerformCalculation that operates on an instance of the class.
You need to ensure that the user interface of the application continues to respond while calculations are being performed. You need to write a code segment that calls the PerformCalculation procedure to achieve this goal.
Which code segment should you use?