Exemplo n.º 1
0
        public RegisterMasterStore1PageViewModel(IRegionManager regionManager, ILocationManager locationManager) : base(regionManager)
        {
            _locationManager = locationManager;

            this.CountriesSelectionChangedCommand = new DelegateCommand(() => ExecuteCountriesSelectionChangedCommand());
            this.StatesSelectionChangedCommand    = new DelegateCommand(() => ExecuteStatesSelectionChangedCommand());
            this.SubmitCommand = new DelegateCommand(() => ExecuteSubmitCommand(),
                                                     () => this.SelectedCountry != null && this.SelectedState != null && this.SelectedCity != null && !string.IsNullOrEmpty(this.PostalCode))
                                 .ObservesProperty(() => this.SelectedCountry)
                                 .ObservesProperty(() => this.SelectedState)
                                 .ObservesProperty(() => this.SelectedCity)
                                 .ObservesProperty(() => SelectedFacilityType)
                                 .ObservesProperty(() => this.PostalCode);

            FacilityTypes = new List <FacilityType>()
            {
                new FacilityType()
                {
                    DisplayName = "(A) Restaurant", Value = "Restaurant", ID = 1
                },
                new FacilityType()
                {
                    DisplayName = "(B) Queue", Value = "Queue", ID = 2
                }
            };
        }
Exemplo n.º 2
0
 public ReservationModel(
     ICarManager _carManager,
     ILocationManager _locationManager)
 {
     carManager      = _carManager;
     locationManager = _locationManager;
 }
Exemplo n.º 3
0
 public LocationAppService(
     IRepository <Location, Guid> locationRepository,
     ILocationManager locationManager)
 {
     _locationRepository = locationRepository;
     _locationManager    = locationManager;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.Portable.ViewModels.ViewModelBase"/> class.
        /// </summary>
        /// <param name="signalRClient">Signal RC lient.</param>
        public ViewModelBase(ISQLiteStorage storage, IScheduler scheduler, Logging.ILogger log,
                             ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController,
                             GoogleMapsWebServiceController googleMapsWebServiceController, IPathLocator pathLocator, IScreen hostScreen,
                             ILocationManager locationManager)
        {
            HostScreen = hostScreen;

            Locations       = new ObservableCollection <Location>();
            CurrentLocation = new Location();

            LocationManager = locationManager;

            ConnectedStatusMessage = Labels.ConnectedTitle.ToUpper();

            Storage = storage;
            scheduler.Schedule((arg1) => Storage.CreateSQLiteConnection());

            WebServiceController           = webServiceController;
            GoogleMapsWebServiceController = googleMapsWebServiceController;
            PathLocator = pathLocator;

            Subscriptions = new CompositeDisposable();

            Scheduler = scheduler;
            ApplicationStateHandler = applicationStateHandler;

            Log = log;
            Tag = $"{GetType()} ";
        }
Exemplo n.º 5
0
        public async Task <Trip> SaveDepartureTime(int locationId, [FromBody] long departureTime)
        {
            ILocationManager m = ObjectContainer.GetLocationManager();
            Location         l = m.Get(locationId);

            if (departureTime == -1)
            {
                l.DepartureTime = null;
            }
            else
            {
                l.DepartureTime = departureTime;
            }

            m.Save(l);

            IMapsManager map  = ObjectContainer.GetMapsManager();
            ITripManager t    = ObjectContainer.GetTripManager();
            Trip         trip = t.Get(l.TripId);

            using (Trip tripX = ObjectContainer.Clone(trip)) { trip = await map.FillBorderPoints(GetUser(), tripX, l); }

            trip.ArrangePoints();

            t.Save(GetUser().ID, trip);

            return(trip);
        }
Exemplo n.º 6
0
 public ReservationsController(
     IReservationManager _reservationManager,
     ILocationManager _locationManager)
 {
     reservationManager = _reservationManager;
     locationManager    = _locationManager;
 }
Exemplo n.º 7
0
        public async Task <Trip> SaveCity(int locationId, [FromBody] string[] names) /*First name is city, second name is country, third is place_id*/
        {
            ILocationManager m = ObjectContainer.GetLocationManager();
            Location         l = m.Get(locationId);

            ICityDbProvider c = ObjectContainer.GetCityDbProvider();

            if (names[0] == "" && names[1] == "" && names[2] == null)
            {
                l.City = null;
            }
            else
            {
                l.City = new City
                {
                    Name          = names[0],
                    CountryID     = c.GetCountryByName(names[1]).ID,
                    GooglePlaceId = names[2]
                };
            }

            m.Save(l);

            IMapsManager map  = ObjectContainer.GetMapsManager();
            ITripManager t    = ObjectContainer.GetTripManager();
            Trip         trip = t.Get(l.TripId);

            using (Trip tripX = ObjectContainer.Clone(trip)) { trip = await map.FillBorderPoints(GetUser(), tripX, l); }

            trip.ArrangePoints();

            t.Save(GetUser().ID, trip);

            return(trip);
        }
Exemplo n.º 8
0
        public Trip SetBorderCrossDate(int locationId, [FromBody] long millis)
        {
            ILocationManager m           = ObjectContainer.GetLocationManager();
            ITripManager     t           = ObjectContainer.GetTripManager();
            IMapsManager     mapsManager = ObjectContainer.GetMapsManager();

            Location l    = m.Get(locationId);
            Trip     trip = t.Get(l.TripId);

            l.CrossedAtDate   = millis;
            l.SectionModified = true;

            if (trip.Locations[l.Position - 1].Transit)
            {
                trip.Locations[l.Position - 1].DepartureDate = millis;
            }
            if (trip.Locations[l.Position + 1].Transit)
            {
                trip.Locations[l.Position + 1].ArrivalDate = millis;
            }

            mapsManager.SetSectionAsModified(GetUser(), trip, l);

            trip.ArrangePoints();

            t.Save(GetUser().ID, trip);
            m.Save(l);

            return(t.Get(l.TripId));
        }
Exemplo n.º 9
0
 public PlacesProvider(
     ILocationManager locationManager,
     IPlacesService placesService)
 {
     _locationManager = locationManager;
     _placesService   = placesService;
 }
Exemplo n.º 10
0
 public RegisteredSipRepository(ISettingsManager settingsManager, ILocationManager locationManager, IMetaRepository metaRepository, IAppCache cache)
     : base(cache)
 {
     _metaRepository = metaRepository;
     LocationManager = locationManager;
     SettingsManager = settingsManager;
 }
Exemplo n.º 11
0
        public void AddTransitCountry(int locationId)
        {
            //CHANGE THIS TO SAVE USING THE WHOLE TRIP SO THAT IT'S THE SAME AS CREATING NORMAL POINTS
            //This whole function might actually be useless
            //locationId is the id of the location BEHIND WHICH this new point will be added

            ILocationManager m           = ObjectContainer.GetLocationManager();
            ITripManager     t           = ObjectContainer.GetTripManager();
            IMapsManager     mapsManager = ObjectContainer.GetMapsManager();

            Location orig    = m.Get(locationId);
            int      origPos = orig.Position;
            Trip     trip    = t.Get(orig.TripId);

            //First add the transit, then the crossing, because it pushes it forward and we're adding inbound travel.
            //Edit these points so that they are useful
            trip.Locations.Insert(origPos, new Location {
                Transit = true, City = new City {
                    Name = "Transit_Country"
                }
            });
            trip.Locations.Insert(origPos, new Location {
                IsCrossing = true, CrossedBorder = true
            });

            trip.ArrangePoints();

            t.Save(GetUser().ID, trip);

            mapsManager.SetSectionAsModified(GetUser(), trip, trip.Locations[origPos]); //This will certianly be the new location as it replaced the original

            t.Save(GetUser().ID, trip);
        }
 public VirtualMachineController(IUnitManager _unitManager, IInventoryManager _InventoryManager, ILocationManager _locationManager, IHostManager _hostManager)
 {
     this._InventoryManager = _InventoryManager;
     this._unitManager      = _unitManager;
     this._locationManager  = _locationManager;
     this._hostManager      = _hostManager;
 }
Exemplo n.º 13
0
        public NonMobileUserPopupPageViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IWindowsManager windowsManager, ILocationManager locationManager) : base(regionManager)
        {
            _eventAggregator = eventAggregator;
            _windowsManager  = windowsManager;
            _locationManager = locationManager;

            this.CancelCommand = new DelegateCommand(() => ExecuteCancelCommand());

            this.FillCommand = new DelegateCommand(async() => await ExecuteFillCommand());

            this.CountriesSelectionChangedCommand = new DelegateCommand(() => ExecuteCountriesSelectionChangedCommand());
            this.StatesSelectionChangedCommand    = new DelegateCommand(() => ExecuteStatesSelectionChangedCommand());

            if (this.Countries == null)
            {
                this.Countries       = _locationManager.GetCountries();
                this.SelectedCountry = this.Countries.FirstOrDefault();

                PostalCodePlaceholder = this.SelectedCountry.Id == 231 ? "Zip Code" : "Postal Code";
            }

            if (this.States == null && this.SelectedCountry != null)
            {
                var states = _locationManager.GetStates();
                this.States        = states.Where(x => x.CountryId == this.SelectedCountry.Id).ToList();
                this.SelectedState = this.States.FirstOrDefault();
            }

            if (this.Cities == null && this.SelectedState != null)
            {
                var cities = _locationManager.GetCities();
                this.Cities       = cities.Where(x => x.StateId == this.SelectedState.Id).ToList();
                this.SelectedCity = this.Cities.FirstOrDefault();
            }
        }
Exemplo n.º 14
0
 public RoomsController(IUserManager userManager, IRoomManager roomManager, IBookingManager bookingManager, ILocationManager locationManager)
 {
     _roomManager     = roomManager;
     _bookingManager  = bookingManager;
     _locationManager = locationManager;
     _userManager     = userManager;
 }
Exemplo n.º 15
0
        public async Task <Trip> SaveArrivalDate(int locationId, [FromBody] long arrivalDate)
        {
            ILocationManager m = ObjectContainer.GetLocationManager();
            Location         l = m.Get(locationId);

            l.ArrivalDate = arrivalDate;

            if (l.ArrivalDate.HasValue && l.DepartureDate.HasValue)
            {
                if (l.Food == null)
                {
                    l.Food = CreateLocationFood((int)(l.DepartureDate / 24 / 60 / 60000 - l.ArrivalDate / 24 / 60 / 60000));
                }
                else
                {
                    l.Food = CreateLocationFood((int)(l.DepartureDate / 24 / 60 / 60000 - l.ArrivalDate / 24 / 60 / 60000), l.Food);
                }
            }

            m.Save(l);

            IMapsManager map  = ObjectContainer.GetMapsManager();
            ITripManager t    = ObjectContainer.GetTripManager();
            Trip         trip = t.Get(l.TripId);

            using (Trip tripX = ObjectContainer.Clone(trip)) { trip = await map.FillBorderPoints(GetUser(), tripX, l); }

            trip.ArrangePoints();

            t.Save(GetUser().ID, trip);

            return(trip);
        }
Exemplo n.º 16
0
        private void AnalyseDirectory(
            string[] directories,
            ILocationManager locationManager,
            IClsNmbManager clsNmbManager,
            IFaultManager faultManager)
        {
            for (int index = 0; index < directories.Length; ++index)
            {
                string[] subDirectories = System.IO.Directory.GetDirectories(directories[index]);
                string[] files          = System.IO.Directory.GetFiles(directories[index], "*.jpg");

                if (files != null && files.Length > 0)
                {
                    this.AnalyseFiles(
                        files,
                        locationManager,
                        clsNmbManager,
                        faultManager);
                }

                if (subDirectories != null && subDirectories.Length > 0)
                {
                    this.AnalyseDirectory(
                        subDirectories,
                        locationManager,
                        clsNmbManager,
                        faultManager);
                }
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// Get all the images in the base path.
        /// </summary>
        /// <returns></returns>
        public List <IImageDetails> ReadImages(
            ILocationManager locationManager,
            IClsNmbManager clsNmbManager,
            IFaultManager faultManager)
        {
            this.Initialise();

            string[] directories = System.IO.Directory.GetDirectories(basePath);
            string[] files       = System.IO.Directory.GetFiles(basePath, "*.jpg");

            if (files != null && files.Length > 0)
            {
                this.AnalyseFiles(
                    files,
                    locationManager,
                    clsNmbManager,
                    faultManager);
            }

            if (directories != null && directories.Length > 0)
            {
                this.AnalyseDirectory(
                    directories,
                    locationManager,
                    clsNmbManager,
                    faultManager);
            }

            return(this.images);
        }
Exemplo n.º 18
0
        public LocationViewModel(ILocationManager locationManager)
        {
            // As soon as the app is done launching, begin generating location updates in the location manager
            _locationManager = locationManager;
            _locationManager.StartLocationUpdates();

            _locationManager.LocationUpdated += HandleLocationChanged;
        }
 public ChooseHomeAddressOnMapViewModel(
     ISettingsProvider settingsProvider,
     INavigationService navigationService,
     ILocationManager locationManager,
     IGeocodingProvider geocodingProvider) : base(navigationService, locationManager, geocodingProvider)
 {
     _settingsProvider = settingsProvider;
 }
        public LocationController(IConfiguration configuration,
                                  ILoggingService loggingService,
                                  ILocationManager locationManager) : base(configuration)
        {
            _logger = loggingService.GetLogger <LocationController>(nameof(LocationController));

            _locationManager = locationManager;
        }
Exemplo n.º 21
0
 public UserController(IUserManager um, IPictureManager pm, ILocationManager locmng,IEmailService es,IAdressManager amng)
 {
     this.um = um;
     this.pm = pm;
     this.locmng = locmng;
     this.es = es;
     this.amng = amng;
 }
Exemplo n.º 22
0
 /// <summary>
 /// Constructor for Program Controller
 /// </summary>
 /// <param name="pm"></param>
 /// <param name="mgr"></param>
 /// <param name="mg"></param>
 public ProgramController(IProgramManager pm, IImageManager mgr , IPatientMedicalDetailManager mg , ILocationManager locmng,IDollarManager dm)
 {
     this.pm = pm;
     this.mgr = mgr;
     this.mg = mg;
     this.locmng = locmng;
     this.dm = dm;
 }
Exemplo n.º 23
0
 public PendingReservationsModel(
     IReservationManager _reservationManager,
     ILocationManager _locationManager
     )
 {
     reservationManager = _reservationManager;
     locationManager    = _locationManager;
 }
Exemplo n.º 24
0
        public LocationController()
        {
            _locationManager     = new LocationManager();
            _organizationManager = new OrganizationManager();
            _branchManager       = new BranchManager();

            PartialMenuView();
        }
 public void OnLocationChanged(ILocationManager locationManager, ILocation oldLocation, ILocation newLocation)
 {
     if (currentSensor != null)
     {
         updateSHSCCell();
         updatePTCell();
     }
 }
Exemplo n.º 26
0
        /// <summary>
        /// Initializes a new <see cref="TestExecutionTransaction"/>.
        /// </summary>
        /// <param name="powershell">The <see cref="PowerShell"/> to manage</param>
        /// <param name="locationManager">Manages a test's output</param>
        public TestExecutionTransaction(PowerShell powershell, ILocationManager locationManager)
        {
            _powershell      = powershell;
            _locationManager = locationManager;

            OutputDirectory = locationManager.OutputDirectory;
            powershell.Runspace.SessionStateProxy.Path.SetLocation(_locationManager.ScriptLocation.FullName);
        }
Exemplo n.º 27
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:ReactiveUIAroundMe.ViewModels.TileViewModel"/> class.
 /// </summary>
 /// <param name="signalRClient">Signal RC lient.</param>
 public HeaderListItemViewModel(ISQLiteStorage storage, IScheduler scheduler, ILogger log,
                                ApplicationStateHandler applicationStateHandler, WebServiceController webServiceController, GoogleMapsWebServiceController googleMapsWebServiceController,
                                IPathLocator pathLocator, IScreen hostScreen, ILocationManager locationManager)
     : base(storage, scheduler, log, applicationStateHandler, webServiceController, googleMapsWebServiceController,
            pathLocator, hostScreen, locationManager)
 {
     Height = 25;
 }
Exemplo n.º 28
0
        public CureDeckManager(ILocationManager locationManager)
        {
            _deck    = new List <Location>();
            _discard = new List <Location>();

            _deck.AddRange(locationManager.GetLocations());
            _deck.ShuffleDeck();
        }
 public ApplicationManager(IUserManager userManager, IFaceManager faceManager, ICameraManager cameraManager, INotificationManager notificationManager, ILocationManager locationManager)
 {
     this.userManager         = userManager;
     this.faceManager         = faceManager;
     this.cameraManager       = cameraManager;
     this.notificationManager = notificationManager;
     this.locationManager     = locationManager;
 }
Exemplo n.º 30
0
 public MapViewModel(ILocationManager locationManager, ApplicationIdCredentialsProvider credentials)
 {
     _locationManager = locationManager;
     _credentials     = credentials;
     _locationManager.OnNewPositionReceived += new EventHandler <NewLocationEventArgs>(_locationManager_OnNewPositionReceived);
     _userPositions = new ObservableCollection <LocationDto>();
     _mapCenter     = new LocationDto();
 }
Exemplo n.º 31
0
        public static IImageDetails AnalyseImageDetails(
            string path,
            ILocationManager locationManager,
            IClsNmbManager clsNmbManager,
            IFaultManager faultManager)
        {
            IImageDetails image;

            string imageName = System.IO.Path.GetFileName(path);

            string[] filenameArray = imageName.Split(extensionSeparator);

            string[] inputArray = filenameArray[0].Split(majorTick);

            if (inputArray.Length < 2 || inputArray.Length > 4)
            {
                faultManager.AddFault(
                    "Can't split into nmb and stn",
                    imageName);
            }

            string[] nmbsArray = inputArray[0].Split(minorTick);

            ILocation stn =
                locationManager.GetStn(
                    inputArray[1]);

            string year =
                inputArray.Length > 2 ?
                inputArray[2] :
                string.Empty;

            string multipleNote =
                inputArray.Length > 3 ?
                inputArray[3] :
                string.Empty;

            image =
                new ImageDetails(
                    path,
                    year,
                    stn,
                    multipleNote);

            ClsClass clss =
                ImageDetailFactory.GetCls(
                    nmbsArray.ToList(),
                    path,
                    faultManager,
                    clsNmbManager);

            image.SetClss(
                clss.Clss,
                clss.PresentNmbs);

            return(image);
        }
Exemplo n.º 32
0
 public PaymentModel(
     ICarManager _carManager,
     ILocationManager _locationManager,
     IReservationManager _reservationManager)
 {
     carManager         = _carManager;
     locationManager    = _locationManager;
     reservationManager = _reservationManager;
 }
Exemplo n.º 33
0
    public static void Initialize(ILocationManager locationManager)
    {
        // This code bootstraps the Motive script engine. First, give the script engine
        // a path that it can use for storing state.
        var smPath = StorageManager.EnsureGameFolder("scriptManager");

        ScriptEngine.Instance.Initialize(smPath);

        // This intializes the Alternate Reality and Location Based features.
        ARComponents.Instance.Initialize(locationManager);

        // This tells the JSON reader how to deserialize various object types based on
        // the "type" field.
        JsonTypeRegistry.Instance.RegisterType("motive.gaming.characterTask", typeof(CharacterTask));
        JsonTypeRegistry.Instance.RegisterType("motive.gaming.playableContent", typeof(PlayableContent));
        JsonTypeRegistry.Instance.RegisterType("motive.gaming.playableContentBatch", typeof(PlayableContentBatch));
        JsonTypeRegistry.Instance.RegisterType("motive.gaming.characterMessage", typeof(CharacterMessage));
        JsonTypeRegistry.Instance.RegisterType("motive.gaming.screenMessage", typeof(ScreenMessage));
        JsonTypeRegistry.Instance.RegisterType("motive.gaming.inventoryCollectibles", typeof(InventoryCollectibles));
        JsonTypeRegistry.Instance.RegisterType("motive.gaming.playerReward", typeof(PlayerReward));

        JsonTypeRegistry.Instance.RegisterType("motive.gaming.inventoryCondition", typeof(InventoryCondition));

        JsonTypeRegistry.Instance.RegisterType("motive.ar.locationTask", typeof(LocationTask));
        JsonTypeRegistry.Instance.RegisterType("motive.ar.locationMarker", typeof(LocationMarker));

        // The Script Resource Processors take the resources from the script processor and
        // direct them to the game components that know what to do with them.
        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.core.scriptLauncher", new ScriptLauncherProcessor());

        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.gaming.characterTask", new CharacterTaskProcessor());
        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.gaming.inventoryCollectibles", new InventoryCollectiblesProcessor());
        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.gaming.playableContent", new PlayableContentProcessor());
        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.gaming.playableContentBatch", new PlayableContentBatchProcessor());
        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.gaming.playerReward", new PlayerRewardProcessor());

        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.ar.locationTask", new LocationTaskProcessor());
        ScriptEngine.Instance.RegisterScriptResourceProcessor("motive.ar.locationMarker", new LocationMarkerProcessor());

        // Register a condition monitor that knows how to handle inventory conditions.
        ScriptEngine.Instance.RegisterConditionMonitor(new InventoryConditionMonitor());
    }
        public FileLocationTree( ILocationManager locationManager, string defaultPath )
        {
            m_Locations = locationManager;

            m_Images = new ImageList( );
            m_FolderImage = AddImage( Windows.Properties.Resources.Folder, true );
            m_FolderOpenImage = AddImage( Windows.Properties.Resources.FolderOpen, true );

            string[] driveNames = Environment.GetLogicalDrives( );
            m_Drives = new Folder[ driveNames.Length ];

            for ( int driveIndex = 0; driveIndex < driveNames.Length; ++driveIndex )
            {
                string driveName = driveNames[ driveIndex ];
                m_Drives[ driveIndex ] = new Folder( null, this, driveName );
            }

            m_Properties = new LocationProperty[]
                {
                    m_NameProperty,
                    m_SizeProperty,
                    m_TypeProperty,
                    m_ModifiedProperty,
                    m_CreatedProperty
                };

            m_DefaultFolder = m_Drives[ 0 ];
            try
            {
                OpenFolder( defaultPath, out m_DefaultFolder );
                return;
            }
            catch ( Exception ex )
            {
                AssetsLog.Exception( ex, "Failed to open default folder \"{0}\"", defaultPath );
            }
        }
Exemplo n.º 35
0
 public LocationService()
 {
     LocationHelper = DependencyService.Get<ILocationManager>();
 }
Exemplo n.º 36
0
 public FilePath( ILocationManager locations, string path )
     : base(locations, path)
 {
 }
 public void OnDeserialized( StreamingContext context )
 {
     m_Locations = Locations.Instance.Find( this );
     m_Name = System.IO.Path.GetFileName( m_Path );
 }
 /// <summary>
 /// Setup constructor
 /// </summary>
 /// <param name="locations">Location manager that created this object</param>
 /// <param name="path">Path to this location</param>
 public LocationPath( ILocationManager locations, string path )
 {
     m_Locations = locations;
     m_Path = path;
     m_Name = System.IO.Path.GetFileName( m_Path );
 }
Exemplo n.º 39
0
 public LocationController(ILocationManager locmng)
 {
     this.locmng = locmng;
 }