コード例 #1
0
        public LocationService(IMvxLocationWatcher watcher)
        {
            StatusMessage = "Current location is being resolved...";

            _watcher = watcher;
            _watcher.Start(new MvxLocationOptions() { TimeBetweenUpdates = new TimeSpan(0, 0, 1), Accuracy = MvxLocationAccuracy.Fine }, OnLocation, OnError);
        }
コード例 #2
0
        public LocationService(IMvxLocationWatcher locationWatcher, IMvxMainThreadAsyncDispatcher dispatcher)
        {
            this._locationWatcher = locationWatcher;
            this._dispatcher      = dispatcher;

            this._locationWatcher.OnPermissionChanged += PermissionChanged;
        }
コード例 #3
0
 public NavigationService(IMvxMessenger messenger, IMvxLocationWatcher watcher, ILocationService locationService)
 {
     _messenger       = messenger;
     _messageToken    = _messenger.Subscribe <LocationMessage>(OnLocationMessage);
     _locationService = locationService;
     _mapDataCache    = XMLHelper.LoadMAPData().ToList();
 }
コード例 #4
0
ファイル: GpsService.cs プロジェクト: alexschott/mwf
 public GpsService(IMvxLocationWatcher locationWatcher)
 {
     _locationWatcher = locationWatcher;
     if (!_locationWatcher.Started)
     {
         _locationWatcher.Start(new MvxLocationOptions(), OnSuccess, OnError);
     }
 }
コード例 #5
0
ファイル: LocationService.cs プロジェクト: knarte/TestingApp
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
 {
     _watcher   = watcher;
     _messenger = messenger;
     _watcher.Start(new MvxLocationOptions()
     {
         Accuracy = MvxLocationAccuracy.Fine, TrackingMode = MvxLocationTrackingMode.Background
     }, OnLocation, OnError);
 }
コード例 #6
0
        //Init
        //

        public WeatherPagedViewModel(WeatherPageModel model, IMvxLocationWatcher watcher, IMvxMessenger massager)
        {
            _massager = massager;
            _token    = _massager.Subscribe <CitiesMassage>(OnUpdateCities);
            _watcher  = watcher;
            _watcher.Start(new MvxLocationOptions(), locationEventHandleAction, errorEventHandleAction);
            _model = model;
            this.InitViewModels();
        }
コード例 #7
0
        public LocationService(IMvxLocationWatcher watcher)
        {
            StatusMessage = "Current location is being resolved...";

            _watcher = watcher;
            _watcher.Start(new MvxLocationOptions()
            {
                TimeBetweenUpdates = new TimeSpan(0, 0, 1), Accuracy = MvxLocationAccuracy.Fine
            }, OnLocation, OnError);
        }
コード例 #8
0
        public FirstViewModel(IMvxLocationWatcher locationWatcher)
        {
            this.locationWatcher = locationWatcher;

            Permission = "not specified";
            Location   = "zero";

            locationWatcher.OnPermissionChanged += OnPermissionChanged;
            locationWatcher.Start(new MvxLocationOptions(), OnLocationUpdated, OnLocationError);
        }
コード例 #9
0
        public LocationServiceSingleton(IApplicationSettingServiceSingleton applicationSettingService, IMvxLocationWatcher mvxLocationWatcher)
        {
            if (applicationSettingService == null)
            {
                throw new ArgumentNullException("applicationSettingService");
            }

            _applicationSettingService = applicationSettingService;
            _watcher = mvxLocationWatcher;
        }
コード例 #10
0
        public LocationServiceSingleton(IApplicationSettingServiceSingleton applicationSettingService, IMvxLocationWatcher mvxLocationWatcher)
        {
            if (applicationSettingService == null)
            {
                throw new ArgumentNullException("applicationSettingService");
            }

            _applicationSettingService = applicationSettingService;
            _watcher = mvxLocationWatcher;
        }
コード例 #11
0
        public LocationViewModel(
            ILoggerFactory logProvider,
            IMvxNavigationService navigation,
            IMvxLocationWatcher locationWatcher)
            : base(logProvider, navigation)
        {
            _locationWatcher = locationWatcher;

            StartCommand = new MvxAsyncCommand(DoStartCommand, () => !_locationWatcher.Started);
        }
コード例 #12
0
 /// <summary>
 /// Constructor for the vehicle service. This service relies on have GPS, Internet and SNTP to sync time correctly. If the SNTP is not
 /// available then the device time is used.
 /// </summary>
 /// <param name="locationService"></param>
 /// <param name="dataAnalyticsService"></param>
 /// <param name="sNTPService"></param>
 /// <param name="networkService"></param>
 /// <param name="timerService"></param>
 /// <param name="GLOSAWebService"></param>
 /// <param name="GLOSAWiFiService"></param>
 public VehicleService(IMvxMessenger messenger, IMvxLocationWatcher watcher, ILocationService locationService, IDataAnalyticsService dataAnalyticsService, ISNTPService sNTPService, INetworkService networkService, ITimerService timerService, IGLOSAWebService GLOSAWebService, IGLOSAWiFiService GLOSAWiFiService)
 {
     _GLOSAAnalyticsService = dataAnalyticsService;
     _sntpService           = sNTPService;
     _networkService        = networkService;
     _timerService          = timerService;
     _GLOSAWebService       = GLOSAWebService;
     _navigationService     = new NavigationService(messenger, watcher, locationService);
     _GLOSAWiFiService      = GLOSAWiFiService;
     _locationService       = locationService;
 }
コード例 #13
0
        //private readonly MvxMessenger _messenger;

        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
        {
            _watcher   = watcher;
            _messenger = messenger;
            var options = new MvxLocationOptions
            {
                MovementThresholdInM = 2500
            };

            _watcher.Start(options, OnLocation, OnError);
        }
コード例 #14
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.map_screen);

            _locationWatcher = Mvx.Resolve <IMvxLocationWatcher>();
            var options = new MvxLocationOptions();

            _locationWatcher.Start(options, OnLocationFound, OnLocationNotFound);
        }
コード例 #15
0
        public LocationViewModel(
            IMvxLogProvider logProvider,
            IMvxNavigationService navigation,
            IMvxLocationWatcher locationWatcher)
            : base(logProvider, navigation)
        {
            _locationWatcher = locationWatcher;

            StartCommand = new MvxAsyncCommand(
                async() => await DoStartCommand().ConfigureAwait(true),
                () => !_locationWatcher.Started);
        }
コード例 #16
0
        public FirstViewModel(IMvxLocationWatcher locationWatcher)
        {
            _locationWatcher = locationWatcher;

            _locationWatcher.Start(new MvxLocationOptions {
                Accuracy = MvxLocationAccuracy.Fine
            }, OnLocation, OnError);
            _lat = _locationWatcher.CurrentLocation.Coordinates.Latitude;
            _lng = _locationWatcher.CurrentLocation.Coordinates.Longitude;
            _locationWatcher.Stop();
            System.Diagnostics.Debug.WriteLine($"Lat: {Lat} Lng: {Lng}");
        }
コード例 #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="SpeedAdvisoryViewModel"/> class.
        /// </summary>
        public SpeedAdvisoryViewModel(IMvxMessenger messenger, IMvxLocationWatcher watcher)
        {
            _vehicleService          = Mvx.Resolve <IVehicleService>();
            _textToSpeechService     = new TextToSpeechService();
            _cancellationTokenSource = new CancellationTokenSource();
            _GLOSAWiFiService        = Mvx.Resolve <IGLOSAWiFiService>();
            // Task.Run(async () => await _textToSpeechService.SpeakAsync("Welcome to GLOSA", _cancellationTokenSource.Token));

            GLOSAMessage         = $"Waiting for connection (WiFi Mode: {Settings.EnableWiFiMode})";
            AdvisorySpeedMessage = "";
            Intersection         = "[Locating intersection]";
        }
コード例 #18
0
ファイル: LocationService.cs プロジェクト: Xciles/Inferno
        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
        {
            _watcher   = watcher;
            _messenger = messenger;
            var options = new MvxLocationOptions()
            {
                Accuracy             = MvxLocationAccuracy.Fine,
                MovementThresholdInM = 5,
                TrackingMode         = MvxLocationTrackingMode.Foreground
            };

            _watcher.Start(options, OnLocation, OnError);
            OnLocation(_watcher.CurrentLocation);
        }
コード例 #19
0
 public LocationService(IMvxMessenger messenger, IMvxLocationWatcher location)
 {
     _messenger        = messenger;
     _location         = location;
     LocationAvailable = false;
     options           = new MvxLocationOptions()
     {
         Accuracy     = MvxLocationAccuracy.Fine,
         TrackingMode = MvxLocationTrackingMode.Background
     };
     if (!_location.Started)
     {
         InitializeLocation(options);
     }
 }
コード例 #20
0
 public FirstViewModel(ICustomerService customerService, IMvxLocationWatcher watcher)
 {
     _customerService = customerService;
     _watcher = watcher;
     if (_watcher != null)
     {
         if (!_watcher.Started)
             _watcher.Start(new MvxLocationOptions(), OnLocationFound, OnError);
     }
     if (string.IsNullOrWhiteSpace(Lat) || string.IsNullOrWhiteSpace(Lon))
     {
         Lat = "12.950545";
         Lon = "77.642149";
     }
 }
コード例 #21
0
ファイル: LocationService.cs プロジェクト: klzig/MapX
        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
        {
            _watcher         = watcher;
            _messenger       = messenger;
            _locationMessage = new LocationMessage(this);
            _updateLoc_token = _messenger.Subscribe <UpdateLocMessage>(OnUpdateLocMessage);

            var options = new MvxLocationOptions
            {
                Accuracy           = MvxLocationAccuracy.Fine,
                TimeBetweenUpdates = TimeSpan.FromSeconds(2),
                TrackingMode       = MvxLocationTrackingMode.Foreground
            };

            _watcher.Start(options, OnLocation, OnError);
        }
コード例 #22
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LocationService" /> class.
        /// </summary>
        /// <param name="watcher">The watcher.</param>
        /// <param name="messenger">The messenger.</param>
        /// <param name="log">The log.</param>
        public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger, ILogger log)
        {
            this._watcher   = watcher;
            this._messenger = messenger;
            this._log       = log;

            var options = new MvxLocationOptions
            {
                Accuracy             = MvxLocationAccuracy.Fine,
                TrackingMode         = MvxLocationTrackingMode.Foreground,
                TimeBetweenUpdates   = TimeSpan.Zero,
                MovementThresholdInM = 0,
            };

            this._watcher.Start(options, this.OnLocation, this.OnError);
        }
コード例 #23
0
        public StartViewModel(IMvxNavigationService navigationService, IMvxLocationWatcher watcher)
        {
            _navigation = navigationService;
            _watcher    = watcher;
            _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
            SearchCmd = new MvxCommand(() =>
            {
                _navigation.Navigate <PostsViewModel, SearchModel>(new SearchModel {
                    KeyWord = this.KeyWord, StartDate = this.StartDate, EndDate = this.EndDate
                });
            });

            EndDate = DateTime.Now.ToShortDateString();

            SetLocationCmd = new MvxCommand(() =>
            {
                // Long = _watcher.CurrentLocation.Coordinates.Longitude;
                // Lat = _watcher.CurrentLocation.Coordinates.Latitude;
                Location = "Lublin";
            });
        }
コード例 #24
0
        public ReportViewModel(IMvxLocationWatcher watcher)
        {
            // Message subs.
            var messenger = Mvx.Resolve <IMvxMessenger>();

            _token = messenger.Subscribe <LocationMessage>(OnLocationMessage);

            // Location service.
            Mvx.RegisterSingleton <ILocationService>(new LocationService(watcher, messenger));

            // Compass.
            CrossCompass.Current.CompassChanged += (s, e) =>
            {
                Heading = e.Heading;
            };
            CrossCompass.Current.Start();

            _timer = new Utils.Timer(async(obj) =>
            {
                await CheckDanger().ConfigureAwait(false);
            }, null, 15000, 15000);
        }
コード例 #25
0
		public MainViewModel(IMvxLocationWatcher locationWatcher)
		{
			this.locationWatcher = locationWatcher;
		}
コード例 #26
0
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
 {
     _watcher   = watcher;
     _messenger = messenger;
     _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
 }
コード例 #27
0
 public PersonBaseViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher)
 {
     SampleAppService = sampleAppService;
        LocationWatcher = locationWatcher;
 }
コード例 #28
0
ファイル: LocationService.cs プロジェクト: fadafido/tojeero
		public LocationService(IMvxLocationWatcher locationWatcher, IMvxMessenger messenger)
		{
			_locationWatcher = locationWatcher;
			_messenger = messenger;
			start();
		}
コード例 #29
0
 public MainViewModel(IMvxLocationWatcher locationWatcher)
 {
     this.locationWatcher = locationWatcher;
 }
コード例 #30
0
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger, IGeoCoderService geoCoder)
 {
     _watcher   = watcher;
     _messenger = messenger;
     _geoCoder  = geoCoder;
 }
コード例 #31
0
 public PersonAddViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher)
     : base(sampleAppService, locationWatcher)
 {
     Person = new Person();
 }
コード例 #32
0
 public TestViewModel(IMvxLocationWatcher locationWatcher)
 {
     _locationWatcher = locationWatcher;
 }
コード例 #33
0
 public Child3ViewModel(IMvxLocationWatcher watcher)
 {
     _watcher = watcher;
     _watcher.Start(new MvxLocationOptions(), OnFix, OnError);
 }
コード例 #34
0
 public LocationService(IMvxLocationWatcher watcher)
 {
     this.watcher = watcher;
 }
コード例 #35
0
 public LocationService(IMvxLocationWatcher watcher, IMvxMessenger messenger)
 {
     _watcher   = watcher;
     _messenger = messenger;
 }
コード例 #36
0
 public PersonDetailViewModel(ISampleAppService sampleAppService, IMvxLocationWatcher locationWatcher)
     : base(sampleAppService, locationWatcher)
 {
 }
コード例 #37
0
 private LocationManager()
 {
     _locationWatcher = Mvx.Resolve <IMvxLocationWatcher>();
     _locationOptions = new MvxLocationOptions();
     _locationOptions.TrackingMode = MvxLocationTrackingMode.Foreground;
 }
コード例 #38
0
 public OmnicTabsViewModel(IMvxLocationWatcher watcher)
 {
     Child1 = new Child1ViewModel(new ImageLoader());
     Child2 = new Child2ViewModel();
     Child3 = new Child3ViewModel(watcher);
 }
コード例 #39
0
 public FirstViewModel(IMvxLocationWatcher watcher)
 {
     _watcher = watcher;
     _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
 }
コード例 #40
0
 public FirstViewModel(IMvxLocationWatcher watcher)
 {
     _watcher = watcher;
     _watcher.Start(new MvxLocationOptions(), OnLocation, OnError);
 }