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);
     }
 }
コード例 #2
0
            public void OnRouteAddedToVehicle(Vehicle vehicle)
            {
                MarkDirty();
                VehicleScheduleData data = Manager <VehicleScheduleDataManager> .Current.GetOrCreateVehicleScheduleData(vehicle);

                data.SubscribeOwnDataChanged(OnVehicleDataChanged);
                data.CallDataChangedEventsForRoute(null);
            }
コード例 #3
0
        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);
            }
        }
コード例 #4
0
            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);
                    }
                }
            }