コード例 #1
0
ファイル: Program.cs プロジェクト: diogotorres97/feup-tdin
    private static void Main()
    {
        _loggerController = new LoggerController();
        _evOrderRepeater  = new OperationEventRepeater <Order>();
        _evOrderRepeater.OperationEvent += DoOrderAlterations;
        _loggerController.AddOrderAlterEvent(_evOrderRepeater.Repeater);

        _evTableRepeater = new OperationEventRepeater <Table>();
        _evTableRepeater.OperationEvent += DoTableAlterations;
        _loggerController.AddTableAlterEvent(_evTableRepeater.Repeater);

        Console.WriteLine("[Logger]");
        Console.WriteLine("Press Enter to terminate.");
        Console.ReadLine();

        _evOrderRepeater.OperationEvent -= DoOrderAlterations;
        _loggerController.RemoveOrderAlterEvent(_evOrderRepeater.Repeater);

        _evTableRepeater.OperationEvent -= DoTableAlterations;
        _loggerController.RemoveTableAlterEvent(_evTableRepeater.Repeater);
    }