public OperationManager(int first, int second, ExcutionManager excutionmanager) { _first = first; _second = second; _excutionmanager = excutionmanager; _excutionmanager.Populatefunction(Sum, Subtract, Multiply); _excutionmanager.PrepareExcution(); }
static void Main(string[] args) { var excutionmanager = new ExcutionManager(); var opator = new OperationManager(20, 10, excutionmanager); var result = opator.Excute(Operation.Sum); Console.WriteLine($"The result of the operation WITH delegates in code: {result}"); ////////////////////////////////////////////////////////////////////////////////////////////////////////////// var opManager = new WithoutDelegates(20, 10); var result2 = opManager.Execute(Operation.Sum); Console.WriteLine($"The result of the operation WITHOUT delegates in code:{result}"); Console.ReadKey(); }