static void Main(string[] args) { ProcessData pro = new ProcessData(); BizRulessProcessDelegate addDelegate = (x, y) => x + y; BizRulessProcessDelegate multiplyDelegate = (x, y) => (x * y); pro.Process(5, 10, addDelegate); pro.Process(5, 10, multiplyDelegate); Action <int, int> actionScadereDelegate = (x, y) => Console.WriteLine(x - y);; pro.ProcessAction(5, 10, actionScadereDelegate); Func <double, double, double> actionDivideDelegate = (x, y) => x / y; pro.ProcessFunc(5, 10, actionDivideDelegate); //ReadFromTxt(); //nu ma prind exact care e treaba aici pro.BizRulessEvent += Pro_BizRulessEvent2; pro.BizRulessEvent += (x, y) => x + y + 100; pro.ProcessEvent(5, 10); }
public void Process(int x, int y, BizRulessProcessDelegate del) { var result = del(x, y); //aici invocam delegat-ul si facem operatiile matematice cum vrem noi, pe baza del Console.WriteLine(result); }