public FCServiceLogic() { //Unity IOC Containter Init: InitContainer(); //resolve repositories: InitRepositories(); //init AirportManager: AirportManager = Container.Resolve <AirportManager>(); //subscribe to airportManager events: AirportManager.Tower.PlaneArriving += OnPlaneArriving; AirportManager.Tower.PlaneDeparturing += OnPlaneDeparturing; AirportManager.Tower.PlaneParked += OnPlaneParked; //subscribe to event in order to bubble event to FlightControlService WCF AirportManager.AirportChanged += OnAirportChanged; //subscribe to event in order to bubble event to FlightControlService WCF //set airport state by Data From DB: List <PlaneDTO> airportPlanes = PlaneRepository.GetAirportPlanes(); AirportManager.GetAirportStateFromDB(airportPlanes); }
//get simulation of event (arrival/depature) from the simulator send it to the airportManager and write the event to the DB public void GetSimulation(PlaneDTO plane) { //send it to the airport Manager: AirportManager.GetSimulation(plane); }