Ejemplo n.º 1
0
        public void DirectCall(HandlerType handlerType)
        {
            MsgHandlerBase handler = null;
            MsgBase        m       = null;

            switch (handlerType)
            {
            case HandlerType.Chief:
                handler = new PoliceChief("MacMahon");
                m       = new ChiefMsg();
                break;

            case HandlerType.Patrol:
                handler = new PolicePatrol("Car102");
                m       = new PatrolMsg();
                break;
            }

            Clock.Timer.Restart();
            handler.ReferencePoint(m);

            // clean up instance
            handler.UnregisterHandlers();
            handler = null;
        }
Ejemplo n.º 2
0
 void CheckCreateChiefInstance()
 {
     if (_Chief == null)
     {
         _Chief = new PoliceChief("MacMahon", true);
     }
 }