private void OnVehicleRouteChanged(Vehicle vehicle, VehicleRoute oldRoute, VehicleRoute newRoute) { if (newRoute != null && oldRoute != newRoute && newRoute.Vehicles.Count > 1) { VehicleScheduleData vehicleData = ReplaceVehicleScheduleDataFromRouteCopy(vehicle); vehicleData.CallDataChangedEventsForRoute(null); } }
public void OnRouteAddedToVehicle(Vehicle vehicle) { MarkDirty(); VehicleScheduleData data = Manager <VehicleScheduleDataManager> .Current.GetOrCreateVehicleScheduleData(vehicle); data.SubscribeOwnDataChanged(OnVehicleDataChanged); data.CallDataChangedEventsForRoute(null); }
private void OnVehicleIsEnabledChanged(Vehicle vehicle) { CacheData cacheData = null; if (vehicle.Route != null && (cacheData = this[vehicle.Route]) != null) { cacheData.MarkDirty(); VehicleScheduleData data = Manager <VehicleScheduleDataManager> .Current.GetOrCreateVehicleScheduleData(vehicle); data.CallDataChangedEventsForRoute(null); } }
public void OnRouteRemovedFromVehicle(Vehicle vehicle, VehicleRoute oldRoute) { MarkDirty(); VehicleScheduleData data = Manager <VehicleScheduleDataManager> .Current[vehicle]; if (data != null) { data.UnsubscribeOwnDataChanged(OnVehicleDataChanged); if (oldRoute.Vehicles.Count > 0) { data = Manager <VehicleScheduleDataManager> .Current[oldRoute.Vehicles[0]]; data.CallDataChangedEventsForRoute(null); } } }