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; }
void CheckCreateChiefInstance() { if (_Chief == null) { _Chief = new PoliceChief("MacMahon", true); } }