1. Question: You need to create a dynamic assembly named MyAssembly. You also need to save the assembly to disk. Which code segment should you use?

    A
    AssemblyName myAssemblyName =
    new AssemblyName();
    AssemblyBuilder myAssemblyBuilder =
    AppDomain.CurrentDomain.DefineDynamicAssembly
    (myAssemblyName, AssemblyBuilderAccess.RunAndSave);
    myAssemblyBuilder.Save("MyAssembly.dll");

    B
    AssemblyName myAssemblyName =
    new AssemblyName();
    myAssemblyName.Name = "MyAssembly";
    AssemblyBuilder myAssemblyBuilder =
    AppDomain.CurrentDomain.DefineDynamicAssembly
    (myAssemblyName, AssemblyBuilderAccess.Save);
    myAssemblyBuilder.Save("MyAssembly.dll");

    C
    AssemblyName myAssemblyName =
    new AssemblyName("MyAssembly");
    AssemblyBuilder myAssemblyBuilder =
    AppDomain.CurrentDomain.DefineDynamicAssembly
    (myAssemblyName, AssemblyBuilderAccess.Save);
    myAssemblyBuilder.Save("c:\\MyAssembly.dll");

    D
    AssemblyName myAssemblyName =
    new AssemblyName();
    "A Composite Solution With Just One Click" - Certification Guaranteed 272 Microsoft 70-536 Exam myAssemblyName.Name = "MyAssembly";
    AssemblyBuilder myAssemblyBuilder =
    AppDomain.CurrentDomain.DefineDynamicAssembly
    (myAssemblyName, AssemblyBuilderAccess.Run);
    myAssemblyBuilder.Save("MyAssembly.dll");

    Note: Not available
    1. Report
  2. Question: 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?

    A
    public class PrintingArgs {
    private EventArgs eventArgs;
    public PrintingArgs(EventArgs ea) {
    this.eventArgs = ea;
    }
    public EventArgs Args
    {
    get { return eventArgs;
    }

    }
    }

    B
    public class PrintingArgs : EventArgs {
    private int copies;
    public PrintingArgs(int numberOfCopies) {
    this.copies = numberOfCopies;
    }
    public int Copies {
    get { return this.copies;
    }

    }
    }

    C
    public class PrintingArgs : EventArgs {
    private int copies;
      }

    D
    public class PrintingArgs {
    private int copies;
    public PrintingArgs(int numberOfCopies) {
    this.copies = numberOfCopies;
    }
    public int Copies {
    "A Composite Solution With Just One Click" - Certification Guaranteed 273 Microsoft 70-536 Exam
    get { return this.copies;
    }

    }
    }

    Note: Not available
    1. Report
  3. Question: You are loading a new assembly into an application. You need to override the default evidence for the assembly. You require the common language runtime (CLR) to grant the assembly a permission set, as if the assembly were loaded from the local intranet zone. You need to build the evidence collection. Which code segment should you use?

    A
    Evidence= evidence = gcnew Evidence();
    evidence->AddHost(gcnew Zone(SecurityZone::Intranet));

    B
    Evidence= evidence = gcnew Evidence();
    evidence->AddAssembly(gcnew Zone(SecurityZone::Intranet));

    C
    Evidence= evidence = gcnew Evidence(Assembly::GetExecutingAssembly()->Evidence);

    D
    Evidence= evidence = gcnew Evidence(AppDomain::CurrentDomain->Evidence);

    Note: Not available
    1. Report
  4. Question: You need to create a dynamic assembly named MyAssembly. You also need to save the assembly to disk. Which code segment should you use?

    A
    AssemblyName= myAssemblyName =
    gcnew AssemblyName("MyAssembly");
    AssemblyBuilder= myAssemblyBuilder =
    AppDomain::CurrentDomain->DefineDynamicAssembly(
    myAssemblyName, AssemblyBuilderAccess::Save);
    myAssemblyBuilder->Save("c:\\MyAssembly.dll");

    B
    AssemblyName= myAssemblyName = gcnew AssemblyName();
    AssemblyBuilder= myAssemblyBuilder
    =
    AppDomain::CurrentDomain->DefineDynamicAssembly(
    "A Composite Solution With Just One Click" - Certification Guaranteed 274 Microsoft 70-536 Exam myAssemblyName, AssemblyBuilderAccess::RunAndSave);
    myAssemblyBuilder->Save("MyAssembly.dll");

    C
    AssemblyName= myAssemblyName = gcnew AssemblyName(); myAssemblyName->Name = "MyAssembly";
    AssemblyBuilder= myAssemblyBuilder =
    AppDomain::CurrentDomain->DefineDynamicAssembly( myAssemblyName, AssemblyBuilderAccess::Save);
    myAssemblyBuilder->Save("MyAssembly.dll");

    D
    AssemblyName= myAssemblyName = gcnew AssemblyName(); myAssemblyName->Name = "MyAssembly";
    AssemblyBuilder= myAssemblyBuilder =
    AppDomain::CurrentDomain->DefineDynamicAssembly(
    myAssemblyName, AssemblyBuilderAccess::Run);
    myAssemblyBuilder->Save("MyAssembly.dll");

    Note: Not available
    1. Report
  5. Question: You are developing a method to call a COM component. You need to use declarative security to explicitly request the runtime to perform a full stack walk. You must ensure that all callers have the required level of trust for COM interop before the callers execute your method. Which attribute should you place on the method?

    A
    [SecurityPermission(
    SecurityAction.Demand,
    Flags=SecurityPermissionFlag.UnmanagedCode)
    ]

    B
    [SecurityPermission(
    SecurityAction.Assert,
    Flags = SecurityPermissionFlag.UnmanagedCode)
    ]

    C
    [SecurityPermission(
    SecurityAction.Deny,
    Flags = SecurityPermissionFlag.UnmanagedCode)
    ]

    D
    [SecurityPermission(
    SecurityAction.LinkDemand,
    Flags=SecurityPermissionFlag.UnmanagedCode)
    ]

    Note: Not available
    1. Report
  6. Question: 

    You develop a service application named PollingService that periodically calls long-running procedures. These procedures are called from the DoWork method.

    You use the following service application code:

    partial class PollingService : ServiceBase {

    bool blnExit = false;

    public PollingService() {

    }

    protected override void OnStart(string[] args) {

    do {

    DoWork();

    } while (!blnExit);

    }

    protected override void OnStop() {

    blnExit = true;

    }

    private void DoWork() {

    ...

    }

    }

    When you attempt to start the service, you receive the following error message: Could not start the PollingService service on the local computer. Error 1053: The service did not respond to the start or control request in a timely fashion.

    You need to modify the service application code so that the service starts properly.

    What should you do?

    A
    Move the loop code from the OnStart method into the DoWork method.

    B
    Add a class-level System.Timers.Timer variable to the service class code. Move the call to the DoWork method into the Elapsed event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.

    C
    Move the loop code into the constructor of the service class from the OnStart method.

    D
    Drag a timer component onto the design surface of the service. Move the calls to the long- running procedure from the OnStart method into the Tick event procedure of the timer, set the Enabled property of the timer to True, and call the Start method of the timer in the OnStart method.

    Note: Not available
    1. Report
  7. Question: You need to write a multicast delegate that accepts a DateTime argument and returns a Boolean value. Which code segment should you use?

    A
    public delegate void PowerDeviceOn(DateTime);

    B
    public delegate int PowerDeviceOn(bool,
    DateTime);

    C
    public delegate bool PowerDeviceOn(Object,
    EventArgs);

    D
    public delegate bool PowerDeviceOn(DateTime);

    Note: Not available
    1. Report
  8. Question: 

    You create a class library that is used by applications in three departments of your company. The library contains a Department class with the following definition.

    public ref class Department {

    public :

    String= name;

    String= manager;

    };

    Each application uses a custom configuration section to store department-specific values in the application configuration file as shown in the following code.

    <Department>

    <name>Hardware</name>

    <manager>Amy</manager>

    </Department>

    You need to write a code segment that creates a Department object instance by using the field values retrieved from the application configuration file.

    Which code segment should you use?

    A
    public ref class deptHandler : public IConfigurationSectionHandler { public :
    Object= Create(Object= parent,
    Object= configContext, System.Xml.XmlNode= section) {

    Department= dept = gcnew Department();
    dept->name = section->Attributes["name"].Value;
    dept->manager = section->Attributes["manager"].Value; return dept;
    }
    };

    B
    public ref class deptElement : public ConfigurationElement { "A Composite Solution With Just One Click" - Certification Guaranteed 278 Microsoft 70-536 Exam
    protected :
    override void DeserializeElement(XmlReader= reader,
    bool= serializeCollectionKey) {
    Department= dept = gcnew Department();
    dept->name = ConfigurationManager::AppSettings["name"]; dept->manager = ConfigurationManager::
    AppSettings["manager"]; return dept;
    }
    };

    C
    public ref class deptHandler :
    public IConfigurationSectionHandler {
    public :

    Object= Create(Object= parent,
    Object= configContext, System.Xml.XmlNode section) {

    Department= dept = gcnew Department();
    dept->name = section->SelectSingleNode("name")->InnerText; dept->manager = section-
    >SelectSingleNode("manager")->InnerText; return dept;
    }
    };

    D
    public ref class deptElement : public ConfigurationElement { protected :
    override void DeserializeElement(XmlReader= reader,
    bool= serializeCollectionKey) {

    Department= dept = gcnew Department();

    dept->name = reader->GetAttribute("name");

    dept->manager = reader->GetAttribute("manager");
    }
    };

    Note: Not available
    1. Report
  9. Question: 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?

    A
    EventLog myLog = new EventLog("Application", ".");
    myLog.Source = "MySource";
    "A Composite Solution With Just One Click" - Certification Guaranteed 279 Microsoft 70-536 Exam
    foreach (EventLogEntry entry in myLog.Entries) {
    if (entry.EntryType == EventLogEntryType.Error ||
    entry.EntryType == EventLogEntryType.Warning) {
    PersistToDB(entry);
    }

    B
    EventLog myLog = new EventLog("Application", ".");
    foreach (EventLogEntry entry in myLog.Entries) {
    if (entry.Source == "MySource") {
    if (entry.EntryType == EventLogEntryType.Error ||
    entry.EntryType == EventLogEntryType.Warning) {
    PersistToDB(entry);
    }
    }
    }

    C
    EventLog myLog = new EventLog("Application", ".");
    myLog.Source = "MySource";
    foreach (EventLogEntry entry in myLog.Entries) {
    if (entry.EntryType == (EventLogEntryType.Error &
    EventLogEntryType.Warning)) {
    PersistToDB(entry);
    }
    }

    D
    EventLog myLog = new EventLog("Application", ".");
    foreach (EventLogEntry entry in myLog.Entries) {
    if (entry.Source == "MySource") {
    PersistToDB(entry);
    }
    }

    Note: Not available
    1. Report
  10. Question: You are writing a method that returns an ArrayList named al. You need to ensure that changes to the ArrayList are performed in a thread-safe manner. Which code segment should you use?

    A
    ArrayList al = gcnew ArrayList();
    lock (al->SyncRoot.GetType())
    {
    return al;
    }
    "A Composite Solution With Just One Click" - Certification Guaranteed 280 Microsoft 70-536 Exam

    B
    ArrayList= al = gcnew ArrayList();
    lock (al->SyncRoot)
    {
    return al; 
      }

    C
    ArrayList= al = gcnew ArrayList();
    ArrayList= sync_al = ArrayList::Synchronized(al);
    return sync_al;

    D
    ArrayList= al = gcnew ArrayList();
    Monitor::Enter(al);
    Monitor::Exit(al);
    return al;

    Note: Not available
    1. Report
Copyright © 2024. Powered by Intellect Software Ltd