Examples of using Delegate type in English and their translations into Russian
{-}
-
Official
-
Colloquial
Name of delegate type- CalcFigures;
What is the general form of a delegate type declaration?
The delegate type name is CalcFigure;
In the body of the Form1 class, declare the delegate type.
The delegate type is named SquareTriangle;
First, in the class, you need to declare the delegate type and event.
The delegate type is declared in a certain class.
The event is declared based on the previously declared delegate type.
The delegate type declaration is as follows.
The methods have exactly the same signature as the delegate type, on the basis of which the MyEvent event was declared.
The delegate type is declared using the keyword‘delegate.
Even_delegate- the name of the delegate type that is used to declare the event;
The delegate type is declared in the class that hosts the delegate demonstration method.
After the declaration of the delegate type, you can declare the delegate himself.
The delegate type and method type declaration is implemented in the Form1 class of the main application form, such as Windows Forms Application.
For more information about declaring a delegate type and declaring a delegate variable, see the topic.
Let the delegate type be declared, which receives three integer type parameters.
If you want to organize a list of methods that are called when an event is called,then the delegate type and method must return a value of void type do not return anything.
Only instead of its own delegate type used generic delegate EventHandler, using which an event is declared.
In some class, let the delegate type and event be declared as follows.
Declare the type of delegate that is shared with the lambda expression.
For applications such as Windows Forms Application, declare the type of the delegate that refers to the method.
If the delegate returns the type void, then when calling the delegate, all methods that are generated in the list(chain) by group addressing will be called.
In the class, you need to declare the type of the delegate named CalcFigure in accordance with the task.
To get a delegate, you first need to declare its type.
The delegate has one signature(declared in the type), but depending on the situation, when the delegate is called, different work is performed program code.
A delegate of this type will receive three parameters of type float and return a value of type float.
Declare the type of delegate in the class.