Example #1
0
 public MainViewModel(IFavoriteTrainRepository favoriteTrainRepository,IStationRepository stationRepository)
     :base("Электрички")
 {
     _favoriteTrainRepository = favoriteTrainRepository;
     _stationRepository = stationRepository;
  
 }
 public SheduleWizardViewModel(IApiFacade apiFacade,IFavoriteTrainRepository favoriteTrainRepository,IStationRepository stationRepository)
     :base("Расписание")
 {
     _apiFacade = apiFacade;
     _favoriteTrainRepository = favoriteTrainRepository;
     _stationRepository = stationRepository;
     FindCommand=new MvxCommand(async ()=> await Find());
     AddToFavoritesCommand=new MvxCommand(async ()=> await AddToFavorites());
     _insertStationCancelationToken=new CancellationTokenSource();
     HideUnusedCommand =new MvxCommand(() =>
     {
         _isAll = !_isAll;
         ShowAndHideUnused();
         SetHideUnusedText();
     });
     _selectDate=new DateTimeOffset(DateTime.Now);
     SetHideUnusedText();
 }
Example #3
0
		public override void ViewDidLoad ()
		{
			base.ViewDidLoad ();
			stationsRepository = new WebStationRepository ();

			var centerPoint = Station.TroncalRouteCenter;
			var centerCoordinate = new CLLocationCoordinate2D (centerPoint.Y, centerPoint.X);
			var bounds = UIScreen.MainScreen.Bounds;

			CameraPosition cameraPosition = CameraPosition.FromCamera (centerCoordinate, 14.0f);
			var map = MapView.FromCamera (new RectangleF (0, 64, bounds.Width, bounds.Height - 60), cameraPosition);
			map.MyLocationEnabled = true;
			map.MapType = MapViewType.Normal;
			map.Settings.MyLocationButton = true;

			this.mapView = map;
			if (UIDevice.CurrentDevice.CheckSystemVersion(7,0)) {
				NavigationBar.Frame = new RectangleF (NavigationBar.Frame.X, NavigationBar.Frame.Y, NavigationBar.Frame.Width, 64.0f);
			}

			var item = new UINavigationItem ("CHART");
			UIBarButtonItem button = new UIBarButtonItem (MainViewController.ResizedImageIcon(UIImage.FromFile("menu.png")), UIBarButtonItemStyle.Bordered, delegate {
				navigation.ToggleMenu();
			});
			UIBarButtonItem closestStationButton = new UIBarButtonItem ("Cercana", UIBarButtonItemStyle.Bordered, delegate {
				FindClosestStation();
			});

			item.LeftBarButtonItem = button;
			item.HidesBackButton = true;
			item.RightBarButtonItem = closestStationButton;
			NavigationBar.PushNavigationItem (item, false);

			notificationView = new GCDiscreetNotificationView ("Buscando estación cercana...", 
			                                                  true, GCDNPresentationMode.Bottom, mapView);
			this.View.AddSubview (map);
			LoadMapInfo ();
		}
Example #4
0
 public StationLogic(IStationRepository repository)
 {
     this._repository = repository;
 }
Example #5
0
 public StationController(
     IStationRepository stationRepository)
 {
     _stationRepository = stationRepository;
 }
 public WeatherController(ILogger <WeatherController> logger, IWeatherClient weatherClient, IStationRepository stationRepository)
 {
     _logger            = logger;
     _weatherClient     = weatherClient;
     _stationRepository = stationRepository;
 }
 public StationService(IStationRepository stationSearchRepository)
 {
     _stationSearchRepository = stationSearchRepository;
 }
 public StationFinderBll(IStationRepository stationRepository,IPrefixTree prefixTree)
 {
     _prefixTree = prefixTree;
     _prefixTree.Add(stationRepository.AllStations());
 }
 public TrainService(ITrainLineRepository trainLineRepository, IStationRepository stationRepository)
 {
     this.trainLineRepository = trainLineRepository;
     this.stationRepository = stationRepository;
 }
Example #10
0
 public SendGridService(IOptions <SendGridSetting> options, ICustomerRepository customerRepository, IHostingEnvironment hostingEnvironment, IRouteRepository routeRepository, IRouteTicketRepository routeTicketRepository, ITicketRepository ticketRepository, IMapper mapper, IStationRepository stationRepository)
 {
     SETTING                = options;
     _customerRepository    = customerRepository;
     _hostingEnvironment    = hostingEnvironment;
     _routeRepository       = routeRepository;
     _routeTicketRepository = routeTicketRepository;
     _ticketRepository      = ticketRepository;
     _mapper                = mapper;
     _stationRepository     = stationRepository;
 }
 public AudiosController(IAudioRepository audioRepository, IStationRepository stationRepository, IFileProvider fileProvider)
 {
     _audioRepository   = audioRepository;
     _stationRepository = stationRepository;
     _fileProvider      = fileProvider;
 }
Example #12
0
 public StationBusinessImpl(IStationRepository repository)
 {
     _repository = repository;
 }
Example #13
0
 public RoutesController(IStationRepository stationsRepository)
 {
     this.stationsRepository = stationsRepository;
 }
 public StationsController(IStationRepository stationRepository)
 {
     _stationRepository = stationRepository;
 }
Example #15
0
 public StationController(IStationRepository repo)
 {
     _stationRepository = repo;
 }
 public StationController(IStationRepository db)
 {
     _db = db;
 }
Example #17
0
 public HomeController(IMemberRepository memberRepository, IEventRepository eventRepository, IStationRepository stationRepository)
 {
     _memberRepository  = memberRepository;
     _eventRepository   = eventRepository;
     _stationRepository = stationRepository;
 }
 public StationServices(HotelDbContext context, IStationRepository stationRepository) : base(context)
 {
     StationRepository = stationRepository;
 }
 public IndividualController(IIndividualRepository individualRepository, IMapper mapper, LinkGenerator linkGenerator, IAuthenticationHelper authenticationHelper, IStationRepository stationRepository)
 {
     IndividualRepository = individualRepository;
     Mapper               = mapper;
     LinkGenerator        = linkGenerator;
     AuthenticationHelper = authenticationHelper;
     StationRepository    = stationRepository;
 }
Example #20
0
 public StationService()
 {
     _repository = new StationRepository();
 }
Example #21
0
 public StationListViewModel(IMvxNavigationService navigationService, IStationRepository stationRepository)
 {
     _navigationService = navigationService;
     _stationRepository = stationRepository;
 }
Example #22
0
 public StationService(IStationRepository stub)
 {
     _repository = stub;
 }
Example #23
0
 public StationController(IStationRepository stationRepository, ILogger <StationController> logger)
 {
     _stationRepository = stationRepository;
     _logger            = logger;
 }
Example #24
0
 public GetStationsQueryWithInterface(IStationRepository stationRepository) =>
Example #25
0
 public PublicTransportRepository(DataContext context, ITicketRepository ticketRepository,
                                  IPricelistItemRepository pricelistItemRepository, ITimeTableRepository timeTableRepository,
                                  IUserDiscountRepository userDiscountRepository, IStationRepository stationRepository,
                                  IMapper mapper, UserManager <User> userManager, ILineRepository lineRepository)
 {
     _context                 = context;
     _ticketRepository        = ticketRepository;
     _pricelistItemRepository = pricelistItemRepository;
     _timeTableRepository     = timeTableRepository;
     _userDiscountRepository  = userDiscountRepository;
     _stationRepository       = stationRepository;
     _mapper         = mapper;
     _userManager    = userManager;
     _lineRepository = lineRepository;
 }
 public SimpleService(IMvxLogProvider logProvider, IStationRepository stationRepository)
 {
     _log = logProvider.GetLogFor <SimpleService>();
     _stationRepository = stationRepository;
 }
 public AuthenticationHelper(IConfiguration configuration, IBusinessRepository businessRepository, IIndividualRepository individualRepository, IStationRepository stationRepository)
 {
     BusinessRepository   = businessRepository;
     IndividualRepository = individualRepository;
     StationRepository    = stationRepository;
     Configuration        = configuration;
 }
 public StationService(IStationRepository IStationRepository, IConnectionRepository IConnectionRepository)
 {
     _IStationRepository    = IStationRepository;
     _IConnectionRepository = IConnectionRepository;
 }
 public StationController(IStationRepository stationRepository,IYandexApiService yandexApiService)
 {
     _stationRepository = stationRepository;
     _yandexApiService = yandexApiService;
 }
Example #30
0
 public StationBLL()
 {
     _stationRepository = new StationRepository();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="YoubikeService"/> class.
 /// </summary>
 /// <param name="mapper">The mapper.</param>
 /// <param name="stationRepository">The station repository.</param>
 public YoubikeService(IMapper mapper,
                       IStationRepository stationRepository)
 {
     this._mapper            = mapper;
     this._stationRepository = stationRepository;
 }
Example #32
0
 public StationBLL(IStationRepository stationRepository)
 {
     _stationRepository = stationRepository;
 }
Example #33
0
 public StationService(IStationRepository _stationRepository, IUnitOfWork unitOfWork)
 {
     stationRepository = _stationRepository;
     this.unitOfWork   = unitOfWork;
 }
Example #34
0
 public StationLogic()
 {
     _repository = new StationRepository();
 }
Example #35
0
 public StationService(IStationRepository istationrepository)
 {
     this._istationrepository = istationrepository;
 }
Example #36
0
 public StationLogic(IStationRepository Stub)
 {
     _repository = Stub;
 }
Example #37
0
 public StationService(IStationRepository stationRepository)
 {
     this.stationRepository = stationRepository;
 }
        public StationService(
            IFirestoreContext context,
            IStationRepository stationRepository,
            IBikeRepository bikeRepository,
            IMembershipService membershipService)
        {
            _context           = context;
            _stationRepository = stationRepository;
            _bikeRepository    = bikeRepository;

            _availableStations = new Lazy <ObservableCollection <Station> >(() =>
            {
                IDictionary <string, ObservableCollection <Station> > allStations =
                    new Dictionary <string, ObservableCollection <Station> >();

                IDictionary <string, IDisposable> subscriptions = new Dictionary <string, IDisposable>();

                ObservableCollection <Station> result = new ObservableCollection <Station>();

                var communities = membershipService.ObserveMemberships();

                communities.CollectionChanged += (sender, args) =>
                {
                    switch (args.Action)
                    {
                    case NotifyCollectionChangedAction.Add:
                        foreach (CommunityMembership membership in args.NewItems)
                        {
                            ObservableCollection <Station> communityStations = new ObservableCollection <Station>();

                            var subscription = _stationRepository
                                               .ObserveStationsFromCommunity(membership.CommunityId)
                                               .Subscribe(stations =>
                            {
                                communityStations.Clear();

                                foreach (var station in stations)
                                {
                                    communityStations.Add(station);
                                }
                            }, exception =>
                            {
                                communityStations.Clear();
                            });

                            subscriptions[membership.CommunityId] = subscription;

                            communityStations.CollectionChanged += StationsChanged;
                            allStations[membership.Id]           = communityStations;
                        }
                        break;

                    case NotifyCollectionChangedAction.Remove:
                        foreach (CommunityMembership membership in args.OldItems)
                        {
                            allStations[membership.CommunityId].CollectionChanged -= StationsChanged;
                            subscriptions[membership.CommunityId].Dispose();
                        }
                        break;

                    case NotifyCollectionChangedAction.Reset:
                        allStations.Clear();

                        foreach (var subscription in subscriptions.Values)
                        {
                            subscription.Dispose();
                        }

                        subscriptions.Clear();
                        break;

                    case NotifyCollectionChangedAction.Move:
                        break;

                    case NotifyCollectionChangedAction.Replace:
                        throw new NotImplementedException();

                    default:
                        throw new NotImplementedException();
                    }
                };

                return(result);

                void StationsChanged(object sender, NotifyCollectionChangedEventArgs args)
                {
                    result.Clear();

                    foreach (var station in allStations.Values.SelectMany(bikes => bikes))
                    {
                        result.Add(station);
                    }
                }
            });
        }
Example #39
0
 /// <summary>
 /// Initializes a new instance of the <see cref="StationSearch"/> class.
 /// </summary>
 /// <param name="stationRepository">The station repository.</param>
 public StationSearch(IStationRepository stationRepository)
 {
     this.stationRepository = stationRepository;
 }
 public StationProvider(IStationRepository repository)
 {
     this.repository = repository;
 }
Example #41
0
 public StationExistsFilter(IStationRepository stationRepository, IStringLocalizer <SharedResources> localizer)
 => (_stationRepository, _localizer) = (stationRepository, localizer);
Example #42
0
 public StationsController(IStationRepository stationsRepository)
 {
     this.stationsRepository = stationsRepository;
 }
 public RouteStationRepository(IStationRepository stationRepository)
 {
     _stationRepository = stationRepository;
 }
Example #44
0
 public StationService(IStationRepository stationRepository)
 {
     this.stationRepository = stationRepository;
 }