public MapPageViewModel(INavigationService navigationService, IPostService postService, IGeolocationService geolocationService) : base(navigationService)
        {
            _postService        = postService;
            _geolocationService = geolocationService;

            Map = new Map(
                MapSpan.FromCenterAndRadius(
                    new Position(37, -122), Distance.FromMiles(0.3)))
            {
                IsShowingUser   = true,
                VerticalOptions = LayoutOptions.FillAndExpand
            };

            foreach (Post post in _postService.GetPosts())
            {
                Map.Pins.Add(new Pin()
                {
                    Position = post.GetPosition(),
                    Type     = PinType.Generic,
                    Label    = post.Name + ": " + post.Description,
                    Address  = post.Address
                });
            }

            UpdateMapCenterAsync();
        }
 public MainWindowService(IGeolocationService geolocationService, IParserService parserService,
                          ILogRepository logRepository)
 {
     _geolocationService = geolocationService;
     _parserService      = parserService;
     _logRepository      = logRepository;
 }
Esempio n. 3
0
        public MainPageViewModel(INavigationService navigationService, IBackgroundService backgroundService)
            : base(navigationService)
        {
            try
            {
                Title = "Main Page";
                _backgroundService = backgroundService;
                var whenNotRunning = this.WhenAnyValue(x => x.BackgroundRunning, running => running == false);
                var whenRunning    = this.WhenAnyValue(x => x.BackgroundRunning, running => running == true);

                StartServiceCommand = ReactiveCommand.Create(StartService, whenNotRunning);
                StopServiceCommand  = ReactiveCommand.Create(StopService, whenRunning);
                BackgroundRunning   = _backgroundService.IsRunning;
                var subscription = _backgroundService
                                   .WhenBackgroundServiceStateChange
                                   .ToPropertyEx(this, x => x.BackgroundRunning);
                _disposed.Add(subscription);

                _geolocatorService = DependencyService.Resolve <IGeolocationService>();
                var sub = _geolocatorService
                          .WhenPositionChange
                          .Subscribe(OnPositionChanged);
                _disposed.Add(sub);
                IsGpsEnabled = CrossGeolocator.Current.IsGeolocationEnabled;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }
Esempio n. 4
0
 public XsfMapsPageViewModel(
     INavigationService navigationService,
     IPageDialogService pageDialogService,
     IGeolocationService geolocationService) : base(navigationService, pageDialogService)
 {
     this.geolocationService = geolocationService;
 }
Esempio n. 5
0
 public TempService(IUnitOfWork unitOfWork, ICassandraService cassandraService, IGeolocationService geolocationService, IMessageService messageService)
 {
     this._unitOfWork         = unitOfWork;
     this._cassandraService   = cassandraService;
     this._geolocationService = geolocationService;
     this._messageService     = messageService;
 }
Esempio n. 6
0
 public AddressesService(
     IDeletableEntityRepository <DeliveryAddress> addressRepository,
     IGeolocationService geolocationService)
 {
     this.addressRepository  = addressRepository;
     this.geolocationService = geolocationService;
 }
 public PackageService(CourierAppDbContext dbContext, IReviewService reviewService, IGeolocationService gpsService, MailQueue mailService)
 {
     _dbContext     = dbContext;
     _reviewService = reviewService;
     _gpsService    = gpsService;
     _mailService   = mailService;
 }
Esempio n. 8
0
 public NewPostViewModel(
     INavigationService navigationService,
     ITagService tagService,
     IPostService postService,
     IImageService imageService,
     IMediaService mediaService,
     IGeolocationService geolocationService,
     IDatabaseService databaseService,
     IPageDialogService dialogService
     ) : base(navigationService)
 {
     Title               = "Nouveau";
     _tagService         = tagService;
     _postService        = postService;
     _imageService       = imageService;
     _mediaService       = mediaService;
     _databaseService    = databaseService;
     _geolocationService = geolocationService;
     _dialogService      = dialogService;
     Tags                  = new ObservableCollection <Tag>(_tagService.GetTags());
     ClearTagCommand       = new DelegateCommand(ClearFilter);
     SavePostCommand       = new DelegateCommand(SavePost, CanSave).ObservesProperty(() => Name).ObservesProperty(() => Description).ObservesProperty(() => ImagePath);
     OpenPhotoCommand      = new DelegateCommand(GetPhoto);
     SaveButtonImageSource = _imageService.GetSource("Icons.save.png");
     IsNewPostMode         = true;
 }
Esempio n. 9
0
        public void SetMockData(IGeolocationService geolocation)
        {
            Locations.Clear();
            void addLocation(string location)
            {
                App.InvokeOnMainThreadAsync(() =>
                                            Locations.Add(new Location(location, Locations.Count + 1, geolocation.GetAddressList(location).FirstOrDefault()))
                                            );
            }

            addLocation("Warszawa");
            addLocation("Wrocław");
            addLocation("Bydgoszcz");
            addLocation("Białystok");
            addLocation("Rzeszów");
            addLocation("Gdańsk");
            addLocation("Poznań");
            addLocation("Kraków");
            addLocation("Szczecin");
            addLocation("Lublin");
            addLocation("Katowice");
            addLocation("Łódź");
            addLocation("Koszalin");
            addLocation("Częstochowa");
            addLocation("Radom");
            addLocation("Płock");
            addLocation("Zamość");
            addLocation("Chojnice");
            addLocation("Świnoujście");
            addLocation("Słupsk");
            addLocation("Opole");
            addLocation("Zielona Góra");
            addLocation("Olsztyn");
        }
        public void When_getting_coordinates_that_have_close_match_with_param_to_true_Then_returns()
        {
            this.geo = new GoogleMapsGeolocationService(ignoreCloseMatches: true, language: new CultureInfo("fr-CA"));
            var actual = this.geo.GetCoordinates("Boisbriand, QC, Canada");

            Assert.That(actual, Is.EqualTo(new Coordinates(-73.83837330, 45.61263380)));
        }
        public void When_getting_coordinates_that_have_close_match_with_param_to_true_but_same_type_Then_throws()
        {
            this.geo = new GoogleMapsGeolocationService(ignoreCloseMatches: true, language: new CultureInfo("fr-CA"));
            var exc = Assert.Throws <MultipleCoordinatesException>(() => this.geo.GetCoordinates("London")); // There are like 4 different localities for that

            Assert.That(exc.Addresses, Has.Length.EqualTo(4));
        }
Esempio n. 12
0
 public EventsFacade(
     IEventService eventService,
     IUserService userService,
     ICommentService commentService,
     INotificationService notificationService,
     IReactionService reactionService,
     IFileService fileService,
     IEventReactionService eventReactionService,
     IGeolocationService geolocationService,
     IEmailService emailService,
     IConfiguration configuration,
     IHttpContextAccessor httpContextAccessor)
 {
     _eventService         = eventService;
     _userService          = userService;
     _commentService       = commentService;
     _notificationService  = notificationService;
     _reactionService      = reactionService;
     _fileService          = fileService;
     _eventReactionService = eventReactionService;
     _geolocationService   = geolocationService;
     _emailService         = emailService;
     _configuration        = configuration;
     _httpContextAccessor  = httpContextAccessor;
 }
 public CommonController(IGeolocationService geolocationservice, IPermissionService permissionService, SiteSettings siteSettings, IWorkContext workContext)
 {
     _geolocationService = geolocationservice;
     _permissionService = permissionService;
     _siteSettings = siteSettings;
     _workContext = workContext;
 }
Esempio n. 14
0
        public TrackingMapView()
        {
            var container = TinyIoCContainer.Current;

            _geolocationService = container.Resolve <IGeolocationService>();

            _geolocationService.LocationUpatedHandler += _geolocationService_LocationUpatedHandler;
        }
Esempio n. 15
0
        public MapViewModel(NavigationServiceWithToken navigationService, IGeolocationService geolocationService) : base(navigationService)
        {
            _autoSuggestion     = new LocationAutoSuggestion(geolocationService);
            _geolocationService = geolocationService;

            TextChangeCommand       = _autoSuggestion.TextChangedCommand;
            SuggestionChosenCommand = _autoSuggestion.SuggestionChosenCommand;
        }
        public void When_getting_coordinates_that_have_no_results_Then_throws()
        {
            Assert.Throws <AddressNotFoundException>(() => this.geo.GetCoordinates(""));


            this.geo = new GoogleMapsGeolocationService(ignoreCloseMatches: true, language: new CultureInfo("fr-CA"));
            Assert.Throws <AddressNotFoundException>(() => this.geo.GetCoordinates(""));
        }
Esempio n. 17
0
        public LocationAutoSuggestion(IGeolocationService reverseGeolocationServiceService)
        {
            _reverseGeolocationServiceService = reverseGeolocationServiceService;

            TextChangedCommand = new RelayCommand <bool>(TextChanged);

            SuggestionChosenCommand = new RelayCommand <object>(SuggestionChosen);
        }
 public MeasuringViewModel(IMeasuringStorageService measuringStorageService,
                           IMvxNavigationService navigationService, IGeolocationService geolocationService)
 {
     _geolocationService      = geolocationService;
     _navigationService       = navigationService;
     _measuringStorageService = measuringStorageService;
     AsyncConstructor();
 }
Esempio n. 19
0
 public LogParserService(IGeolocationService geolocationService,
                         ILogsWriteRepository logsWriteRepository,
                         ILog logger)
 {
     this.geolocationService  = geolocationService;
     this.logsWriteRepository = logsWriteRepository;
     this.logger = logger;
 }
Esempio n. 20
0
 public EntryViewModel(IMeasuringStorageService measuringStorageService,
                       IMvxNavigationService navigationService, IGeolocationService geolocationService)
 {
     _navigationService       = navigationService;
     _measuringStorageService = measuringStorageService;
     _geolocationService      = geolocationService;
     // converter = new ByteArrayToImageValueConverter();
 }
 public LocationService(
     IMvxLog logger,
     IGeolocationService geolocation,
     IGeocodingService geocoding)
 {
     this.logger      = logger;
     this.geolocation = geolocation;
     this.geocoding   = geocoding;
 }
Esempio n. 22
0
        public ShopMapFragment(IMessanger messanger,
                               IGeolocationService geolocationService,
                               ISettingsRepository settingsRepository)
        {
            _token = messanger.Subscribe <ShopCreatedMessage>(HandleShopCreated);

            _geolocationService = geolocationService;
            _settingsRepository = settingsRepository;
        }
 public NoteHandler(
     IGeolocationService geolocationService,
     INoteMeClientMapper mapper,
     INoteMeContextFactory factory)
 {
     _geolocationService = geolocationService;
     _mapper             = mapper;
     _factory            = factory;
 }
 public WeatherFacade(
     IGeolocationService geolocationService,
     IWeatherForecastService weatherForecastService,
     ITemperatureUnitConverter temperatureUnitConverter)
 {
     _geolocationService = geolocationService;
     _weatherForecastService = weatherForecastService;
     _temperatureUnitConverter = temperatureUnitConverter;
 }
Esempio n. 25
0
 public GeolocatesController(ILogger logger,
                             IGeolocationRepository geolocationRepository,
                             IGeolocationService geolocationService,
                             Services.RestClient.Interface.IRestClient restClient)
 {
     _logger = logger;
     _geolocationRepository = geolocationRepository;
     _geolocationService    = geolocationService;
     _restClient            = restClient;
 }
Esempio n. 26
0
		public SearchViewModel 
			(IGeolocationService geolocationViewModel,
			ILanguageService languageService)
		{
			_languageService = languageService;

			_geolocationViewModel = geolocationViewModel;

			_geolocationViewModel.UserLocationChangedEvent += OnUserLocationChanged;
		}
Esempio n. 27
0
        public EditAddressViewModel(INavigationService navigationService, IGeolocationService geolocationService, IPageDialogService dialogService) : base(navigationService)
        {
            //_navigationService = navigationService ?? throw new ArgumentNullException("navigationService");
            _geolocationService = geolocationService;
            _dialogService      = dialogService;

            BackCommand = new DelegateCommand(BackCommandRecieverAsync);
            DoneCommand = new DelegateCommand(DoneCommandRecieverAsync);
            GetCurrentLocationCommand = new DelegateCommand(GetCurrentLocationCommandRecieverAsync);
        }
Esempio n. 28
0
        public SearchViewModel
            (IGeolocationService geolocationViewModel,
            ILanguageService languageService)
        {
            _languageService = languageService;

            _geolocationViewModel = geolocationViewModel;

            _geolocationViewModel.UserLocationChangedEvent += OnUserLocationChanged;
        }
Esempio n. 29
0
        public EventOverviewViewModel(IEventService eventService, IDataService dataService,
                                      IGeolocationService locationService)
        {
            this.Title            = "Near events";
            this._eventService    = eventService;
            this._dataService     = dataService;
            this._locationService = locationService;

            this.LoadEvents();
        }
        public void When_getting_coordinates_with_natural_feature_result_Then_works(string address, double longitude, double latitude)
        {
            var actual = this.geo.GetCoordinates(address);

            Assert.That(actual, Is.EqualTo(new Coordinates(longitude, latitude)));


            this.geo = new GoogleMapsGeolocationService(ignoreCloseMatches: true, language: new CultureInfo("fr-CA"));
            actual   = this.geo.GetCoordinates(address);
            Assert.That(actual, Is.EqualTo(new Coordinates(longitude, latitude)));
        }
        public void When_getting_all_information_Then_returns_multiple_results()
        {
            var results = this.geo.GetAllAddressInformation("Boston");

            Assert.That(results, Has.Length.EqualTo(6));


            this.geo = new GoogleMapsGeolocationService(ignoreCloseMatches: true, language: new CultureInfo("fr-CA"));
            results  = this.geo.GetAllAddressInformation("Boston");
            Assert.That(results, Has.Length.EqualTo(6));
        }
Esempio n. 32
0
 public GeolocationController(
     IGeolocationDataService geolocationDataService,
     IGeolocationService geolocationService,
     IIpAddressValidator ipAddressValidator,
     IGeolocationDataConverter geolocationDataConverter)
 {
     _geolocationDataService   = geolocationDataService;
     _geolocationService       = geolocationService;
     _ipAddressValidator       = ipAddressValidator;
     _geolocationDataConverter = geolocationDataConverter;
 }
 public ProjectService(ICacheManager cacheManager, IGeolocationService geolocationService, IMessageQueueService messageQueueService, IRepository<Project> projectRepository, IRepository<ProjectLocation> projectLocationRepository, IRepository<ProjectUserHistory> projectUserHistoryRepository, IWebHelper webHelper, IWorkContext workContext)
 {
     _cacheManager = cacheManager;
     _geolocationService = geolocationService;
     _messageQueueService = messageQueueService;
     _projectRepository = projectRepository;
     _projectLocationRepository = projectLocationRepository;
     _projectUserHistoryRepository = projectUserHistoryRepository;
     _webHelper = webHelper;
     _workContext = workContext;
 }
 public ProjectController(ICategoryService categoryService, ICommentService commentService, IGeolocationService geolocationService, ILocationService locationService, ILogService logService, IModerationQueueService moderationQueueService, IProjectService projectService, IProfanityService profanityService, SiteSettings siteSettings, IUserService userService, IWebHelper webHelper, IWorkContext workContext)
 {
     _categoryService = categoryService;
     _commentService = commentService;
     _geolocationService = geolocationService;
     _locationService = locationService;
     _logService = logService;
     _moderationQueueService = moderationQueueService;
     _profanityService = profanityService;
     _projectService = projectService;
     _siteSettings = siteSettings;
     _userService = userService;
     _webHelper = webHelper;
     _workContext = workContext;
 }
 public ViewModelToSqlVodelConvertor(IGeolocationService geoServ, ISqLitePostsService sqltServ)
 {
     this.geolocationService = geoServ;
     this.sqLiteService = sqltServ;
 }