A question to the delegate-class and it accepts parameters?

Hey all, just started to learn delegates. there is an example:
// Class method will be notified with the delegate.
 static class MyClass
{
 // Create a static method that we plan to report to the delegate.
 public static void Method()
{
 Console.WriteLine("Line brought this method with a delegate.");
}
}

 // 21-th line create a class-delegate named MyDelegate,
 // method that will be notified with an instance of this class delegate 
 // will take anything and there will be nothing to return.

 public delegate void MyDelegate(); // Create a delegate class. (1) 

 class Program
{
 static void Main()
{
 MyDelegate myDelegate = new MyDelegate(MyClass.Method); // Create an instance of the delegate. (2)

 myDelegate.Invoke(); // Call this method with a delegate. (3)

 myDelegate(); // Another way to call this method with a delegate. (3')

 // Delay.
Console.ReadKey();
}
 }

please note, at this line:
public delegate void MyDelegate(); // Create a delegate class. (1)

this course is provided in the form of video lessons, the author says the following:

"please note that the method (the default constructor in our class the delegate), which will be reported to this instance of this class-delegate - nothing needs to take , and also do not need to return "

here's my question: what is the default constructor of the delegate-class :nothing needs to take , and also do not need to return " is an axiom for all delegates when you create, or this is a specific case due to the fact that the delegate, in this case this with this method:
public static void Method()
{
 Console.WriteLine("Line brought this method with a delegate.");
 }

which accepts nothing as parameters, and is void i.e. not return anything and does not affect whether this method to the principles of the delegate and the parameters of its constructor?
Ie in the end it either

  • a common axiom
  • a particular case of the construction of class the delegate is notified with this method

here is an answer I want an explanation and an answer, which of the two options is correct.
July 12th 19 at 22:03
2 answers
July 12th 19 at 22:05
Solution
In answer to your question is a particular case of the construction of class the delegate is notified with this method.
When you create the delegate-class (public delegate void MyDelegate();), you specify the signature of methods which can then be reported by the delegate.
As an example here you accept a delegate with parameters and return value.
public delegate int MyDelegate(int a, int b);
Now you can report with this delegate methods with the same signature. For example
public static int Sum(int a, int b)
{
 return a+b;
 }

The delegate is invoked
class Program
{
 static void Main()
{
 MyDelegate myDelegate = new MyDelegate(MyClass.Sum); 
 int result = myDelegate(5, 10);
}
 }
July 12th 19 at 22:07
Solution
What is the delegate constructor? which class is the delegate? what are you talking about? a delegate is a type that represents a reference to a method that satisfies some signature. In your case the signature - nothing input, nothing on output. Sobsno docks .
MyDelegate myDelegate = new MyDelegate(MyClass.Method)

With such records you need inside the "designer" transfer method matching the delegate signature.

Find more questions by tags C#