Answer the question
In order to leave comments, you need to log in
Why is the return type of the method specified, a delegate named PriceChange?
I kind of understood this moment, but not really. I don't understand his behavior, what is he doing? It is of type in the property is specified in order to pass the value to the PriceChange delegate itself with the int price parameter? Can you please explain this point, otherwise, with these delegates, the whole head is already melting ...
Answer the question
In order to leave comments, you need to log in
A delegate is a wrapper that stores a pointer to one or more methods.
PriceChange describes methods with which parameters it can contain. PriceChangeHandler is a delegate type variable into which the pointer to the method will be placed. In order to call a method that is written in PriceChangeHandler, a call is made in this form PriceChangeHandler (parameters for the method)
Here it is crookedly done. I had to start an event.
Delegates are usually used to extend some kind of functionality.
But events (which are also delegates) are used more for notifications.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question