public CommunityBikesViewModel(IDialogService dialogService, IBikeService bikeService, IMembershipService membershipService, INavigationService navigationService, string id) { _dialogService = dialogService; _bikeService = bikeService; _navigationService = navigationService; _communityId = id; AddBikeCommand = CreateCommand(AddBike); EditBikeCommand = CreateCommand <Bike>(EditBike, CanEditBike); PropertyChanged += (_, args) => { if (args.PropertyName == nameof(CurrentUserMembership)) { OnPropertyChanged(nameof(CanAddBike)); } }; Bikes = _bikeService.ObserveBikesFromCommunity(_communityId); Bikes.CollectionChanged += (_, _) => OnPropertyChanged(nameof(SortedBikes)); membershipService.Observe(_communityId).Subscribe( membership => CurrentUserMembership = membership, exception => CurrentUserMembership = null); }
public BikeController(IBikeService bikeService, IUserManagerService userManagerService, ICommitProvider commitProvider, IOrderRepository orderRepository, IOrderService orderService) { _bikeService = bikeService; _userManagerService = userManagerService; _commitProvider = commitProvider; _orderRepository = orderRepository; _orderService = orderService; }
public TrainService( ILogger <TrainService> log, IBikeService bikeService) // ERROR! { _log = log; _bikeService = bikeService; _log.LogInformation("Instanciated [Singleton] TrainService {InstanceId}", this); }
public void SetUp() { mockRepo = new Mock <IBikeRepository>(); mockMapper = new Mock <IMapper>(); mockHistoryService = new Mock <IBikeHistoryService>(); mockHistoryNoteService = new Mock <IHistoryNoteService>(); mockInspectionService = new Mock <IObjectInspectionService>(); bikeService = new BikeService(mockMapper.Object, mockRepo.Object, mockHistoryService.Object, mockHistoryNoteService.Object, mockInspectionService.Object); }
public RealTimeModel(ISchedulerProvider schProvider, IBikeService bikeService) { _schProvider = schProvider; _bikeService = bikeService; _bikeDataSource = new SourceCache<StationDto, string>(bike => bike.Name); _all = _bikeDataSource.AsObservableCache(); var data = GenerateRealTimeData(); _cleanup = new CompositeDisposable(_all, _bikeDataSource, data); }
public EditBikeViewModel( IDialogService dialogService, ILockService lockService, IBikeService bikeService, IMembershipService membershipService, ICommunityService communityService, ILocationPicker locationPicker, IQRCodeScanner qrCodeScanner, INavigationService navigationService, string communityId, string bikeId) { _dialogService = dialogService; _lockService = lockService; _bikeService = bikeService; _membershipService = membershipService; _communityService = communityService; _locationPicker = locationPicker; _qrCodeScanner = qrCodeScanner; _navigationService = navigationService; _communityId = communityId; _bikeId = bikeId; SetLocationCommand = CreateCommand <Bike>(SetLocation, CanSetLocation); RenameBikeCommand = CreateCommand <Bike>(RenameBike, CanRenameBike); DeleteBikeCommand = CreateCommand <Bike>(DeleteBike, CanDeleteBike); ShowCurrentLenderCommand = CreateCommand <Bike>(ShowCurrentLender, CanShowCurrentLender); AddLockCommand = CreateCommand <Bike>(AddLock, CanAddLock); AddLockWithQRCodeCommand = CreateCommand <Bike>(AddLockWithQRCode, CanAddLock); OpenLockCommand = CreateCommand <Bike>(OpenLock, CanOpenLock); CloseLockCommand = CreateCommand <Bike>(CloseLock, CanCloseLock); RemoveLockCommand = CreateCommand <Bike>(RemoveLock, CanRemoveLock); PropertyChanged += (_, args) => { switch (args.PropertyName) { case nameof(Bike): { OnPropertyChanged(nameof(Name)); OnPropertyChanged(nameof(LendState)); OnPropertyChanged(nameof(LockState)); break; } case nameof(CurrentUserMembership): { // Needed to update permissions for the commands OnPropertyChanged(nameof(Bike)); break; } } }; }
public OverviewViewModel( IBikeService bikeService, ILocationService locationService, IStationService stationService, INavigationService navigationService, IDialogService dialogService) { _locationService = locationService; _navigationService = navigationService; _dialogService = dialogService; _locationService = locationService; ShowBikeOnMapCommand = CreateCommand <Bike>(ShowBikeOnMap, CanShowBikeOnMap); RefreshUserLocationCommand = CreateCommand(RefreshUserLocation); ToggleMapCommand = CreateCommand(ToggleMap); ShowMap = Preferences.Get("ShowMap", false); PropertyChanged += (_, args) => { switch (args.PropertyName) { case nameof(ShowMap): OnPropertyChanged(nameof(ToggleMapText)); Preferences.Set("ShowMap", ShowMap); break; case nameof(UserLocation): OnPropertyChanged(nameof(GroupedItems)); break; case nameof(AllBikes) or nameof(AllStations): OnPropertyChanged(nameof(MapItems)); OnPropertyChanged(nameof(GroupedItems)); break; } }; var bikes = bikeService.GetAvailableBikes(); bikes.CollectionChanged += (_, _) => { AllBikes.ReplaceRange(bikes); OnPropertyChanged(nameof(AllBikes)); }; var stations = stationService.GetAvailableStations(); stations.CollectionChanged += (_, _) => { AllStations.ReplaceRange(stations); OnPropertyChanged(nameof(AllStations)); }; }
public RentalCompany(string name, IBikeService service, IIncomeCalculator calculator, IRentedBikeService rentedService) { if (string.IsNullOrEmpty(name)) { throw new RentalCompanyNotNullException(); } Name = name; _service = service; _calculator = calculator; _rentedBikeService = rentedService; }
public HomeController( ILogger <HomeController> log, IBikeService bikeService, ICarService carService, ITrainService trainService) { _log = log; _bikeService = bikeService; _carService = carService; _trainService = trainService; }
public BikeViewModel( IBikeService bikeService, ILockService lockService, IDialogService dialogService, ICommunityService communityService) { _bikeService = bikeService; _lockService = lockService; _dialogService = dialogService; _communityService = communityService; LendBikeCommand = CreateCommand <Bike>(LendBike, bikeService.CanLendBike); ReturnBikeCommand = CreateCommand <Bike>(ReturnBike, bikeService.CanReturnBike); ReserveBikeCommand = CreateCommand <Bike>(ReserveBike, bikeService.CanReserveBike); DeleteReservationCommand = CreateCommand <Bike>(DeleteReservation, bikeService.CanDeleteReservation); TakeBreakCommand = CreateCommand <Bike>(TakeBreak, CanTakeBreak); EndBreakCommand = CreateCommand <Bike>(EndBreak, CanEndBreak); ReportProblemCommand = CreateCommand <Bike>(ReportProblem, CanReportProblem); }
public RentService( IDepositCalculator depositCalculator, IRepository <Rent> rentRepository, IDepositService depositService, IBikeService bikeService) { if (depositCalculator == null) { throw new ArgumentNullException(nameof(depositCalculator)); } if (rentRepository == null) { throw new ArgumentNullException(nameof(rentRepository)); } _depositCalculator = depositCalculator; _rentRepository = rentRepository; _depositService = depositService; _bikeService = bikeService; }
public StationDetailViewModel( IStationService stationService, IBikeService bikeService, IDialogService dialogService, string communityId, string stationId) { _stationService = stationService; _bikeService = bikeService; _dialogService = dialogService; _communityId = communityId; _stationId = stationId; PropertyChanged += (_, args) => { if (args.PropertyName == nameof(Station)) { OnPropertyChanged(nameof(Name)); OnPropertyChanged(nameof(Description)); } }; }
public BikeController(IBikeService bikeService, ILogger <BikeController> logger) { BikeService = bikeService; Logger = logger; }
public MoveBikeCommand(IBikeService bikeService) { _bikeService = bikeService; }
public FileController(IBikeService bikeService, IMapper mapper) { this.bikeService = bikeService; this.mapper = mapper; }
public BikeController(IBikeService bikeService) { _bikeService = bikeService ?? throw new ArgumentNullException(nameof(IBikeService)); }
public BikesController(ApplicationDbContext data, IBikeService bikeService, IMapper mapper) { this.data = data; this.bikeService = bikeService; this.mapper = mapper; }
public UpdateBikeHandler(IBikeService bikeService, IEventPublisher client) { _bikeService = bikeService; _client = client; }
public AddNewBikeCommand(IBikeService bikeService) { _bikeService = bikeService; }
public Bike(IBikeService bikeService) { _bikeService = bikeService; }
public UpdateBikeStatusByIdAsyncCommandHandler(IBikeService bikeService) { _bikeService = bikeService; }
public AddBikeCommand(IBikeNameVerifier bikeNameVerifier, IBikeService bikeService) { _bikeNameVerifier = bikeNameVerifier; _bikeService = bikeService; }
public GetAllBikesHandler(IBikeService bikeService) { _bikeService = bikeService; }
public AddBikeToRentPointCommand(IBikeService bikeService) { _bikeService = bikeService; }
public HomeController(IBikeService bikeService, ITripService tripService, IUserManagerService userManagerService) { _bikeService = bikeService; _tripService = tripService; _userManagerService = userManagerService; }
public DeleteBikeHandler(IBikeService bikeService, IEventPublisher client) { _client = client; _bikeService = bikeService; }
public BikesController(IBikeService bikeService) { this.bikeService = bikeService; }
public BikeController(IBikeService bikeService) { _bikeService = bikeService; }
public GetBikeByIdHandler(IBikeService bikeService) { _bikeService = bikeService; }
public DeleteBikeByIdAsyncCommandHandler(IBikeService bikeService) { _bikeService = bikeService; }
public GetBikeByIdAsyncQueryHandler(IBikeService bikeRepository) { _bikeRepository = bikeRepository; }