An event can be used to provide notifcations. You can subscribe to an event if you are interested in those notifcations. You can also create your own events and raise them to provide notifcations when something interesting happens
This quiz is in C# .NET quiz collection.
Start quizDelegates are a type that defnes a method signature and can contain a reference to a method.
Delegates can be instantiated, passed around, and invoked.
Lambda expressions, also known as anonymous methods, use the = operator and form a compact way of creating inline methods.
Events are a layer of syntactic sugar on top of delegates to easily implement the publish-subscribe pattern.
Events can be raised only from the declaring class. Users of events can only remove and add methods the invocation list.
You can customize events by adding a custom event accessor and by directly using the underlying delegate type.
You have a private method in your class and you want to make invocation of the method possible by certain callers. What do you do?
You have declared an event on your class, and you want outside users of your class to raise this event. What do you do?
You are using a multicast delegate with multiple subscribers. You want to make sure that all subscribers are notifed, even if an exception is thrown. What do you do?
© 2017 QuizBucket.org