public StatsCollector(ILocationStatsRepository locationStats, ILocationProvider locationProvider, TimeSpan collectionPeriod) { _locationStats = locationStats; _locationProvider = locationProvider; _undeliyngThread = new Thread(Run); CollectionPeriod = collectionPeriod; }
public static void SetLocationProvider(ILocationProvider locationProvider) { if (LocationProvider == null) { LocationProvider = locationProvider; } }
public MortgageApplicationProcessor( ILocationProvider locationProvider, ITimeProvider timeProvider, IOfferService offerService) { this.locationProvider = locationProvider; this.timeProvider = timeProvider; this.offerService = offerService; }
// Unity: Start void Start() { // Populate places and events data GetUTDData(); // Get current location provider instance _locationProvider = LocationProviderFactory.Instance.DefaultLocationProvider; _locationProvider.OnLocationUpdated += LocationUpdated; // fixed update time: 1 second Time.fixedDeltaTime = 1; }
public RestfulResult(IResponseWriter responseWriter, object content, string viewName, IResponseUpdater responseUpdater, IStatusCodeTranslator statusCodeTranslator, ILocationProvider locationProvider, IContextHelper contextHelper) { _responseWriter = responseWriter; _responseUpdater = responseUpdater; _statusCodeTranslator = statusCodeTranslator; _locationProvider = locationProvider; _contextHelper = contextHelper; _viewName = viewName; _content = content; }
public NgosService(INgoRepository ngoRepository, IUserRepository userRepository, ILocationProvider locationProvider, IMapper mapper) { _ngoRepository = ngoRepository; _userRepository = userRepository; _locationProvider = locationProvider; _mapper = mapper; }
public static void Create (string googleApiKeyNative, string googleApiKeyWeb, ErrorTranslator errorTranslator, ILocationProvider locationProvider) { new AppCommon (googleApiKeyNative, googleApiKeyWeb, locationProvider) { ErrorTranslator = errorTranslator, }; // Post construction inits ThreadPool.QueueUserWorkItem ((x) => Inst.LocationProvider.Connect ()); }
public static void Create(string googleApiKeyNative, string googleApiKeyWeb, ErrorTranslator errorTranslator, ILocationProvider locationProvider) { new AppCommon(googleApiKeyNative, googleApiKeyWeb, locationProvider) { ErrorTranslator = errorTranslator, }; // Post construction inits ThreadPool.QueueUserWorkItem((x) => Inst.LocationProvider.Connect()); }
public void ProvideRequireLocationObject_EmptyCollection() { // arrange var providers = new ILocationProvider[] {}; var obj = new MyClass(providers); // act var result = obj.ProvideRequireLocationObject(); // assert Assert.IsNull(result); }
public MainViewModel() { _weatherProvider = Mvx.Resolve <ICurrentWeatherProvider>(); _locationProvider = Mvx.Resolve <ILocationProvider>(); _messenger = Mvx.Resolve <IMvxMessenger>(); CurrentWeather = new CurrentWeatherDto(); GetCurrentWeatherCommand = new MvxAsyncCommand(GetCurrentWeatherAsync); SendChangeBackgroundMessageCommand = new MvxCommand(SendChangeBackgroundMessage); }
public MainViewModel(CoreDispatcher updateDispatcher, ILocationProvider locationProvider) { _updateDispatcher = updateDispatcher; _provider = locationProvider; if (locationProvider != null) { _provider.StatusChanged += OnProviderStatusChanged; _provider.PositionChanged += OnProviderPositionChanged; } }
private async void OnProviderStatusChanged(ILocationProvider sender, EventArgs <PositionStatus> args) { if (_updateDispatcher != null) { await _updateDispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { Status = args.Data; }); } else { Status = args.Data; } }
public BoardService(ILocationProvider locationProvider) { _locationProvider = locationProvider; string connectionString = ConfigurationManager.ConnectionStrings["StorageConnection"].ConnectionString; CloudStorageAccount cloudAccount = CloudStorageAccount.Parse(connectionString); CloudTableClient tableClient = cloudAccount.CreateCloudTableClient(); _messagesTable = tableClient.GetTableReference("buildboardmessages"); _messagesTable.CreateIfNotExists(); }
public MapHelper(ILogger <MapHelper> log, IResponseBuilder responseBuilder, IItemProvider itemProvider, ILocationProvider locationProvider, IAdventureContextHelper advHelper) { _log = log; _responseBuilder = responseBuilder; _itemProvider = itemProvider; _locationProvider = locationProvider; _advHelper = advHelper; }
public void ProvideRequireLocationObject_NoRequiredLocation() { // arrange var providers = new ILocationProvider[] { new TestLocationProvider(false) }; var obj = new MyClass(providers); // act var result = obj.ProvideRequireLocationObject(); // assert Assert.IsNull(result); }
public bool RecallCounty(ILocationProvider provider) { if (provider != null) { GeoLocateResult r = provider.LocateIp(_Address); if (r != null) { Country = r.ISOCode; return(true); } } return(false); }
public void ProvideRequireLocationObject_OneRequiredLocation() { // arrange var providers = new ILocationProvider[] { new TestLocationProvider(true) }; var obj = new MyClass(providers); // act var result = obj.ProvideRequireLocationObject(); // assert Assert.AreEqual(providers[0], result); }
void Start() { if (_initializeOnStart) { var latLonSplit = _latitudeLongitudeString.Split(','); Initialize(new Vector2d(double.Parse(latLonSplit[0]), double.Parse(latLonSplit[1])), _zoom); } else { _locationProvider = LocationProviderFactory.Instance.DefaultLocationProvider; _locationProvider.OnLocationUpdated += LocationProvider_OnLocationUpdated; } }
public Search( ILocationProvider locationProvider, ISearchingManager searchingManager, CurrentContext currentContext, INavigationService navigationService, MainPageViewModel mainPageViewModel) { _locationProvider = locationProvider; _searchingManager = searchingManager; _currentContext = currentContext; _navigationService = navigationService; _mainPageViewModel = mainPageViewModel; }
void Start() { _locationProvider = LocationProviderFactory.Instance.DefaultLocationProvider; if (_locationProvider != null) { _locationProvider.OnLocationUpdated += LocationProvider_OnLocationUpdated; } _map.OnInitialized += () => _isInitialized = true; _map.OnInitialized += LoadARObject; //LoadARObject(); _ARFocus = GameObject.FindObjectOfType <ARFocusSquare>(); }
public BaseHandler(ILogger <BaseHandler> log, IResponseBuilder responseBuilder, IMessageProvider messageProvider, ILocationProvider locationProvider, IAdventureContextHelper advHelper, IMapHelper mapHelper) { _log = log; _responseBuilder = responseBuilder; _messageProvider = messageProvider; _locationProvider = locationProvider; _advHelper = advHelper; _mapHelper = mapHelper; }
// Start is called before the first frame update public void Start() { try { if (_meshModifiers == null) { _meshModifiers = new MeshModifier[] { new LineMeshModifier() }; } if (_abstractMap == null) { _abstractMap = FindObjectOfType <AbstractMap>(); } expedition = Newtonsoft.Json.JsonConvert.DeserializeObject <Expedition>(jsonFile.text); // Fill the guide coordinates in radians foreach (var data in expedition.guide) { if (float.TryParse(data.lat, out float lat) && float.TryParse(data.lon, out float lon)) { data.CoordinatesRadians = new System.Numerics.Vector2(ConvertToRadians(lat), ConvertToRadians(lon)); } } // Fill the participants coordinates in radians foreach (var participant in expedition.participants) { foreach (var data in participant) { if (float.TryParse(data.lat, out float lat) && float.TryParse(data.lon, out float lon)) { data.CoordinatesRadians = new System.Numerics.Vector2(ConvertToRadians(lat), ConvertToRadians(lon)); } } } // Get the location provider if (locationProviderFactory != null) { locationProvider = locationProviderFactory.DefaultLocationProvider; } myGameObject.transform.localPosition = new Vector3(myGameObject.transform.localPosition.x, myGameObject.transform.localPosition.y - 20f, myGameObject.transform.localPosition.z); } catch (Exception) { } }
/// <summary> /// Creates a location provider depending on the provider's name /// </summary> /// <param name="providerName">Provider name</param> /// <param name="locationProviderKey">API Key</param> /// <param name="coordinatesFilePath">Full path to the location coordinates data</param> /// <returns></returns> public static ILocationProvider Create(string providerName, string locationProviderKey, string coordinatesFilePath) { ILocationProvider retour = null; switch (providerName.ToLowerInvariant()) { case "bing": retour = new BingLocationProvider(locationProviderKey, coordinatesFilePath); break; case "google": default: break; } return(retour); }
private AppCommon(string googleApiKeyNative, string googleApiKeyWeb, ILocationProvider locationProvider) { Inst = this; IsLoggedIn = false; GoogleApiKeyNative = googleApiKeyNative; GoogleApiKeyWeb = googleApiKeyWeb; Log = new Logger(); IsPassenger = new DynProp <bool> (true); LoadAppData(); PlacesProvider = new PlacesProvider(); DirectionsProvider = new DirectionsProvider(); LocationProvider = locationProvider; NearestPointProvider = new NearestPointProvider(); IsPassenger.Value = AppData.IsLastUserPassenger; }
public EveApiService( ISolarSystemsProvider solarSystemsProvider, IConstellationsProvider constellationsProvider, IRegionsProvider regionsProvider, IPlanetaryResourcesProvider planetaryResourcesProvider, ILocationProvider locationProvider, IBlueprintsProvider blueprintsProvider, IItemsProvider itemsProvider) { this.Systems = solarSystemsProvider; this.Constellations = constellationsProvider; this.Regions = regionsProvider; this.PlanetaryResources = planetaryResourcesProvider; this.Locations = locationProvider; this.Blueprints = blueprintsProvider; this.Items = itemsProvider; }
public static void AddProvider(ILocationProvider provider) { if (provider == null) { throw new Exception("[LocationSourceManager] Cannot add a null provider!"); } var providerType = provider.GetSourceType(); if (ActiveProviders.None(p => p.GetSourceType() == providerType)) { Debug.Log("Provider of type " + providerType + " added"); ActiveProviders.Add(provider); LocationProviderAdded(instance, new EventArg <SourceType> (provider.GetSourceType())); } else { Debug.Log("Provider of type " + providerType + " already found!"); } }
public override void Awake() { base.Awake(); #if UNITY_EDITOR Provider = new MockLocationProvider(); if (MockLocationData != null) { Logger.LogFromMethod("ARLocationProvider", "Awake", $"Using mock location {MockLocationData}", DebugMode); ((MockLocationProvider)Provider).mockLocation = MockLocationData.Location; } #elif ARGPS_CUSTOM_PROVIDER // If you want to use a custom location provider, add 'ARGPS_CUSTOM_PROVIDER' to the define symbols in the Player // settings, create a implementation of ILocationProvider, and instantiate it in the line below. Provider = new ARGpsCustomLocationProvider(); #else Provider = new UnityLocationProvider(); #endif Logger.LogFromMethod("ARLocationProvider", "Awake", ": Using provider " + Provider.Name, DebugMode); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); SetContentView(Resource.Layout.cam); var title = "Exhibit ID:"; Title = title + Intent.GetStringExtra("id"); world = "wikitude" + File.Separator + Intent.GetStringExtra("id") + File.Separator + "index.html"; architectView = FindViewById <ArchitectView>(Resource.Id.architectView); var config = new ArchitectView.ArchitectConfig(AppSettings.WikitudeSDKkeyAndroid); architectView.OnCreate(config); this.architectView.RegisterSensorAccuracyChangeListener(this); this.locationProvider = new LocationProvider(this, this); }
public bool RecallCounty(ILocationProvider provider) { if (provider != null) { GeoLocateResult r = provider.LocateIp(_Address); if (r != null) { string cn, ct; if (StringHelper.Split(r.ISOCode, '-', out cn, out ct)) { Continent = cn; Country = ct; } else { Country = r.ISOCode; } return(true); } } return(false); }
public static void RemoveProvider(ILocationProvider provider) { if (provider == null) { throw new Exception("[LocationSourceManager] Cannot remove a null provider!"); } if (ActiveProviders.Contains(provider)) { ActiveProviders.Remove(provider); provider.StopLocationService(); LocationProviderRemoved(instance, new EventArg <SourceType> (provider.GetSourceType())); Debug.Log("Provider of type " + provider.GetSourceType() + " removed"); } else { Debug.Log("Cannot find the provider!"); } if (IsRunning) { StartLocationUpdates(); } }
public IList <IStorageLocation> CreateMedia ( DicomMediaWriterParameters mediaParameters, ILocationProvider sotrageProvider ) { if (null != sotrageProvider) { int framesCount = 1; List <IStorageLocation> locations = new List <IStorageLocation> ( ); var dataset = GetMediaDataset(mediaParameters.Dataset, mediaParameters.MediaInfo); string transferSyntax = (!string.IsNullOrWhiteSpace(mediaParameters.MediaInfo.TransferSyntax)) ? (mediaParameters.MediaInfo.TransferSyntax) : ""; if (StoreMultiFrames) { DicomPixelData pd; pd = DicomPixelData.Create(mediaParameters.Dataset); framesCount = pd.NumberOfFrames; } for (int frame = 1; frame <= framesCount; frame++) { var storeLocation = sotrageProvider.GetLocation(MediaFactory.Create(mediaParameters.Dataset, frame, MediaType, transferSyntax)); Upload(dataset, frame, storeLocation); locations.Add(storeLocation); } return(locations); } throw new InvalidOperationException("No MediaStorage service found"); }
public JarvisWcfService(ILocationProvider locationProvider, IMappingEngine mapper) { this._locationProvider = locationProvider; _mapper = mapper; }
public GPS(ILocationProvider provider) { _provider = provider; }
public ParkingSpotTracker(ILocationProvider locationProvider) { _locationProvider = locationProvider; }
public MotionSensor(ILocationProvider provider) { TRIGGER = 20; Location = provider.Location; }
public RestfulResult Build(IResponseWriter responseWriter, object content, string viewName, IStatusCodeTranslator statusCodeTranslator, ILocationProvider locationProvider) { return new RestfulResult(responseWriter, content, viewName, _responseUpdater, statusCodeTranslator, locationProvider, _contextHelper); }
public void SetUp() { _responseUpdater = MockRepository.GenerateStub<IResponseUpdater>(); _responseWriter = MockRepository.GenerateStub<IResponseWriter>(); _statusCodeTranslator = MockRepository.GenerateStub<IStatusCodeTranslator>(); _locationProvider = MockRepository.GenerateStub<ILocationProvider>(); _contextHelper = MockRepository.GenerateStub<IContextHelper>(); _content = new {}; }
public LocationController(ILocationProvider locationProvider) { DisposeContext = false; LocationProvider = locationProvider; }
protected override void OnCreate(Bundle bundle) { base.OnCreate (bundle); // Create your application here this.VolumeControlStream = Android.Media.Stream.Music; SetContentView(Resource.Layout.sample_cam); var title = "Test World"; if (Intent.Extras != null && Intent.Extras.Get (EXTRAS_KEY_ACTIVITY_TITLE_STRING) != null) title = Intent.Extras.GetString (EXTRAS_KEY_ACTIVITY_TITLE_STRING); Title = title; architectView = FindViewById<ArchitectView>(Resource.Id.architectView); //TODO: SDK KEY var config = new ArchitectView.ArchitectConfig (Constants.WIKITUDE_SDK_KEY); architectView.OnCreate (config); this.architectView.RegisterSensorAccuracyChangeListener (this); this.locationProvider = new LocationProvider (this, this); }
public FeedbackService(IRequestProvider requestProvider, IRidesService ridesService, ILocationProvider locationProvider) { _requestProvider = requestProvider; _ridesService = ridesService; _locationProvider = locationProvider; }
public DbInitializer(ILocationProvider provider) { _provider = provider; }
private AppCommon(string googleApiKeyNative, string googleApiKeyWeb, ILocationProvider locationProvider) { Inst = this; IsLoggedIn = false; GoogleApiKeyNative = googleApiKeyNative; GoogleApiKeyWeb = googleApiKeyWeb; Log = new Logger (); IsPassenger = new DynProp<bool> (true); LoadAppData (); PlacesProvider = new PlacesProvider (); DirectionsProvider = new DirectionsProvider (); LocationProvider = locationProvider; NearestPointProvider = new NearestPointProvider (); IsPassenger.Value = AppData.IsLastUserPassenger; }
public Gps(ILocationProvider provider) { _provider = provider; }
public GameService(ISessionStorage <GameState> ss, ILocationProvider lp) { _ss = ss; _lp = lp; State = new GameState(); }
public void SetupTestData() { _addressToExpectedTags = new SortedList<string, ILocation>(); _target = new GoogleLocationProvider(new WebRequestFactory()); string address = "1600 Amphitheatre Parkway, Mountain View, CA"; ILocation google = new Location.Location { GeoLat = (decimal)37.4217590, GeoLong = (decimal)-122.0843700, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Mountain View")), (new Tag(TagType.loc, "CA")), (new Tag(TagType.loc, "USA"))/*, (new Tag(TagType.loc, "US"))*/ } }; _addressToExpectedTags.Add(address, google); address = "30 Fitzroy Street, New Plymouth"; ILocation fitzroy = new Location.Location { GeoLat = (decimal)-39.0443597, GeoLong = (decimal)174.1080569, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Taranaki")), (new Tag(TagType.loc, "Fitzroy")), (new Tag(TagType.loc, "New Zealand")) /*, (new Tag(TagType.loc, "NZ"))*/ } }; _addressToExpectedTags.Add(address, fitzroy); address = "20 Lambton Quay"; ILocation lambton = new Location.Location { GeoLat = (decimal)-41.2786929, GeoLong = (decimal)174.7785322, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Wellington")), (new Tag(TagType.loc, "Wellington Central")), (new Tag(TagType.loc, "New Zealand")),/*, (new Tag(TagType.loc, "NZ"))*/ } }; _addressToExpectedTags.Add(address, lambton); address = "20 Pitt Street,Sydney"; ILocation sydney = new Location.Location { GeoLat = (decimal)-33.816636, GeoLong = (decimal)150.997453, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "New South Wales")), (new Tag(TagType.loc, "Sydney")), (new Tag(TagType.loc, "Australia"))/*, (new Tag(TagType.loc, "AU"))*/ } }; _addressToExpectedTags.Add(address, sydney); address = "Sheikh+Zayed+Road,+Dubai,+UAE"; ILocation uae = new Location.Location { GeoLat = (decimal) /*25.2286509*/25.0621743, GeoLong = (decimal) /*55.2876798*/55.1302461, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Dubai")), (new Tag(TagType.loc, "Dubai")), (new Tag(TagType.loc, "United Arab Emirates"))/*, (new Tag(TagType.loc, "AE"))*/ } }; _addressToExpectedTags.Add(address, uae); address = "30+Rue+Baudin,+Paris,+France"; ILocation france = new Location.Location { GeoLat = (decimal)48.895, GeoLong = (decimal)2.2520471, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Courbevoie")), (new Tag(TagType.loc, "île-de-france")), (new Tag(TagType.loc, "France"))/*, (new Tag(TagType.loc, "Fr"))*/ } }; _addressToExpectedTags.Add(address, france); address = "30 Borough Rd, London"; ILocation uk = new Location.Location { GeoLat = (decimal)51.4988744, GeoLong = (decimal)-0.1018722, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Camberwell")), (new Tag(TagType.loc, "Greater London")), (new Tag(TagType.loc, "UK"))/*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, uk); address = "halswell"; ILocation halswell = new Location.Location { GeoLat = (decimal)-43.5854361, GeoLong = (decimal)172.5710715, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Halswell")), (new Tag(TagType.loc, "Canterbury")), (new Tag(TagType.loc, "New Zealand")) /*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, halswell); address = "Dilworth street"; ILocation dilworth = new Location.Location { GeoLat = (decimal)-43.5317993, GeoLong = (decimal)172.6019896, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "Riccarton")), (new Tag(TagType.loc, "Canterbury")), (new Tag(TagType.loc, "New Zealand"))/*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, dilworth); address = "Saint Martins"; ILocation stMartins = new Location.Location { GeoLat = (decimal)-43.555463, GeoLong = (decimal)172.6517792, Address = address, Tags = new List<ITag> { (new Tag(TagType.loc, "St Martins")), (new Tag(TagType.loc, "Canterbury")), (new Tag(TagType.loc, "New Zealand"))/*, (new Tag(TagType.loc, "GB"))*/ } }; _addressToExpectedTags.Add(address, stMartins); }
public SlowFileDownloader(ILocationProvider locationProvider) =>
public RegexMessageParser(ITagRepository tagProvider, ILocationProvider locationProvider) { _tagProvider = tagProvider; _locationProvider = locationProvider; }