static void Main(string[] args) { // var delegate01 = new Delegate(); var delegate02 = new Delegate01(Method01); delegate02 += Method02; delegate02 += Method03; // NOTHING IS RUNNING!!! // TO RUN , CAN CALL DELEGATE WITH BRACKETS delegate02(); var delegate03 = new Delegate03(Method04); delegate03(10, 100); // MOST COMMON DELEGATE TYPE IS TYPE OF void MyDelegate(); // IE NO INPUTS, NO OUTPUTS ==> ACTION DELEGATE!!! var delegate04 = new Action(Method01); // often see word 'Action()' in code ==> POINTER TO METHOD TYPES OF Void DoThis(); }
static void Main(string[] args) { //var delegate01 = new Delegate(); var delegate02 = new Delegate01(Method01); delegate02 += Method02; delegate02 += Method03; //Nothing is running //To run, can call delegate with brackets delegate02(); var delegate03 = new Delegate03(Method04); delegate03(10, 100); //Most common delegate type is type of void MyDelegate(); //I.e no inputs, no outputs ==> action delegate var delegate04 = new Action(Method01); //often see the word Action() in code ==> pointer to method types of void DoThis(); }