Exemplo n.º 1
0
        public void Initialize(Common.OrderList l)
        {
            list = l;
            awaiting_delivery = new Common.OrderEventHandler(list, Common.status.pronta);
            my_deliveries = new Common.OrderEventHandler(list, Common.status.entrega);

            list.OnReady += awaiting_delivery.HandleAddToOrders;
            list.OnDelivering += awaiting_delivery.HandleRemoveFromOrders;

            list.OnFinished += my_deliveries.HandleRemoveFromOrders;
        }
Exemplo n.º 2
0
        public void Initialize(Common.OrderList l)
        {
            list = new Common.OrderList();
            new_orders = new Common.OrderEventHandler(list, Common.status.encomendada);
            preparing_orders = new Common.OrderEventHandler(list, Common.status.preparacao);

            list.OnNew += new_orders.HandleAddToOrders;
            list.OnPreparing += new_orders.HandleRemoveFromOrders;

            list.OnPreparing += preparing_orders.HandleAddToOrders;
            list.OnReady += preparing_orders.HandleRemoveFromOrders;
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            RemotingConfiguration.Configure("TestClient.exe.config", false);
            Console.WriteLine("Press <Enter> to terminate.");

            Common.OrderList list = new Common.OrderList();
            Common.OrderItem[] cenas = new Common.OrderItem[2];
            cenas[0] = new Common.OrderItem("sushi", 1);
            cenas[1] = new Common.OrderItem("abc", 2);
            Common.Order o = new Common.Order(list.GetCurrentId(), new Common.Client("hudur", "morada", "c"), cenas, 10);

            //list.OnNew += list.HandleOnNew;
            Common.OrderEventHandler hand = new Common.OrderEventHandler(list, Common.status.encomendada);
            list.OnNew += hand.HandleAddToOrders;

            //list.OnPreparing += new Common.OrderEventHandler().HandleOnPreparing;

            list.AddOrder(o);

            Console.Write(hand.relevant_orders.Count);
            Console.ReadLine();
            list.OnNew -= hand.HandleAddToOrders;
        }