• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

How to study your flashcards.

Right/Left arrow keys: Navigate between flashcards.right arrow keyleft arrow key

Up/Down arrow keys: Flip the card between the front and back.down keyup key

H key: Show hint (3rd side).h key

A key: Read text to speech.a key

image

Play button

image

Play button

image

Progress

1/10

Click to flip

10 Cards in this Set

  • Front
  • Back
  • 3rd side (hint)
What is the purpose of a 'delegate'?
A delegate provides a means of encapsulating a method reference. The delegate can then be passed to code that will call the referenced method. Therefore, the calling code does not know ahead of time what method will be called.
How does the manner in which a delegate treats static and instance methods differ?
When a delegate invokes a static method a delegate encapsulates only the method, however, when a delegate invokes an instance method the delegate encapsulates both an instance and the method.
What conditions must be met before a delegate can invoke a method?
The methods signature must match the delegate's signature. The delegate does not care what class contains the methods. This property makes delegate useful for invoking methods from "utility" classes.
How do delegates help the programmer manage n-tier applications?
Delegate provide a means to bridge application tiers because it encapsulates resource management in the appropriate tier.
What is a multicast delegate?
A multicast delegate is a delegate that is composed of two or more methods.
What are the requirements for composing delegates?
All methods added to the delegate must have the same signature and, additionally, they must return void.
In what order does a delegate call the multicast methods.
First in first called in the order entered.
How are delegates instantiated?
With the "new" operator.
Same way as a class object.
What namespace implements delegates?
using System;
It's really basic.
How can you put off the creation of a delegate until it is needed?
Wrap its instantiation in a property.
Like a property.