public DevicesController(
            IDeviceCommunicationService deviceCommunicationService,
            DeviceCommunicationExtJsWeb.GpsCommunicationService.IGpsCommunicationContract gpsCommunicationContract,
            
            IDeviceRepository deviceRepository,
            IPacketRepository packetRepository,
            IEventRepository eventRepository,
            ICurrentEventRepository currentEventRepository,
            IRequstAckCommandRepository requstAckCommandRepository,
            ICacheDataRepository cacheDataRepository,
            
            IDeviceStateDocuments deviceStateDocuments,
            
            IDailyMileageRepository dailyMileageRepository,
            IGeoPointRepository geoPointRepository,
            ILogDocuments logDocuments)
        {
            DeviceCommunicationService = deviceCommunicationService;

            DeviceRepository = deviceRepository;
            PacketRepository = packetRepository;
            EventRepository = eventRepository;
            CurrentEventRepository = currentEventRepository;
            RequstAckCommandRepository = requstAckCommandRepository;
            CacheDataRepository = cacheDataRepository;

            DeviceStateDocuments = deviceStateDocuments;

            GpsCommunicationContract = gpsCommunicationContract;

            DailyMileageRepository = dailyMileageRepository;
            GeoPointRepository = geoPointRepository;

            LogDocuments = logDocuments;
        }
Ejemplo n.º 2
0
 public AvsysHandler(IAvsysParser parser, ILogger logger, IDeviceRepository deviceRepository, ICommandService commandService)
 {
     this._parser = parser;
     this._logger = logger;
     this._deviceRepository = deviceRepository;
     this._commandService = commandService;
 }
Ejemplo n.º 3
0
 public StateController(ISignboardRepository signboardRepository, IDeviceRepository deviceRepository, ICompanyRepository companyRepository, ILoggingComponent loggingComponent)
 {
     SignboardRepository = signboardRepository;
     DeviceRepository = deviceRepository;
     CompanyRepository = companyRepository;
     LoggingComponent = loggingComponent;
 }
Ejemplo n.º 4
0
 public AnalysisesController(IRepository<string, Building> buildingRepository,
     IDeviceRepository deviceRepository, IBillRespository billRepository)
 {
     this.buildingRepository = buildingRepository;
     this.deviceRepository = deviceRepository;
     this.billRepository = billRepository;
 }
Ejemplo n.º 5
0
        public SetDeviceValue(IDeviceRepository deviceRepository, IEnumerable<string> parameters)
        {
            mDeviceRepository = deviceRepository;

            mDeviceToSet = parameters.ElementAtOrDefault(0);
            mValueToSet = parameters.ElementAtOrDefault(1);
        }
 public DeviceService(IDeviceRepository deviceRepository, IUnitOfWork unit)
 {
     _deviceRepository = deviceRepository;
        _unit = unit;
        Mapper.CreateMap<Device, DalDevice>();
        Mapper.CreateMap<DalDevice, Device>();
 }
Ejemplo n.º 7
0
        public Logger(ILogRepository logRepository, IDeviceRepository deviceRepository)
        {
            if (logRepository == null) throw new ArgumentNullException(nameof(logRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(_deviceRepository));

            _logRepository = logRepository;
            _deviceRepository = deviceRepository;
        }
Ejemplo n.º 8
0
        public IftttConnector(ICredentialsRepository credentialsRepository, IDeviceRepository deviceRepository)
        {
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));

            _credentialsRepository = credentialsRepository;
            _deviceRepository = deviceRepository;
        }
Ejemplo n.º 9
0
 public DeviceManager(IDeviceRepository repo, IUserManager userManager, IFileSystem fileSystem, ILibraryMonitor libraryMonitor, IConfigurationManager config, ILogger logger)
 {
     _repo = repo;
     _userManager = userManager;
     _fileSystem = fileSystem;
     _libraryMonitor = libraryMonitor;
     _config = config;
     _logger = logger;
 }
Ejemplo n.º 10
0
 public DevicesController(
     IDeviceRepository deviceRepository,
     IDeviceService deviceService,
     UserManager<User> userManager)
 {
     _deviceRepository = deviceRepository;
     _deviceService = deviceService;
     _userManager = userManager;
 }
Ejemplo n.º 11
0
        public AdmissionRepository(IPatientRepository patientRepo, IHospitalBedRepository bedRepo, IDeviceRepository deviceRepo, ICustomDeviceRepository customRepo, bool test = false)
        {
            m_patientRepo          = patientRepo;
            m_bedRepo              = bedRepo;
            m_customDeviceRepo     = customRepo;
            m_defaultDeviceRepo    = deviceRepo;
            patientAdmissionReader = new SqlPatientAdmissionReader();

            conString = test ? @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=RulesBasedAlertingDB.Test;Integrated Security=True" : @"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=RulesBasedAlertingDB;Integrated Security=True";
        }
Ejemplo n.º 12
0
 public DeviceSetupService(IDeviceRepository deviceRepository, IServerConfigRepository serverConfigRepository, IPracticeRepository practiceRepository, IPersonRepository personRepository, IProviderRepository providerRepository, IUserRepository userRepository, IModuleRepository moduleRepository)
 {
     _deviceRepository       = deviceRepository;
     _serverConfigRepository = serverConfigRepository;
     _practiceRepository     = practiceRepository;
     _personRepository       = personRepository;
     _providerRepository     = providerRepository;
     _userRepository         = userRepository;
     _moduleRepository       = moduleRepository;
 }
Ejemplo n.º 13
0
        internal Device(string name, string address, IDeviceRepository deviceRepository, IUIThreadService uiThreadService)
        {
            _deviceRepository = deviceRepository;
            _uiThreadService  = uiThreadService;

            _name        = name;
            Address      = address;
            _deviceState = DeviceState.Disconnected;
            _outputLevel = DefaultOutputLevel;
        }
Ejemplo n.º 14
0
 public CodeController(AppState appState, IUserRepository userRepository,
                       IDeviceRepository deviceRepository,
                       ICodeRepository repository, UserManager <ApplicationUser> userManager)
 {
     _appState         = appState;
     _userRepository   = userRepository;
     _deviceRepository = deviceRepository;
     _repository       = repository;
     _userManager      = userManager;
 }
		public AuthenticationService(IUserRepository userRepository, IDeviceRepository deviceRepository, IRefugeesUnitedService refugeesUnitedService)
		{
			if (userRepository == null) throw new ArgumentNullException("userRepository");
			if (deviceRepository == null) throw new ArgumentNullException("deviceRepository");
			if (refugeesUnitedService == null) throw new ArgumentNullException("refugeesUnitedService");

			UserRepository = userRepository;
			DeviceRepository = deviceRepository;
			RefugeesUnitedService = refugeesUnitedService;
		}
Ejemplo n.º 16
0
 public TechnicHubDevice(
     string name,
     string address,
     byte[] deviceData,
     IDeviceRepository deviceRepository,
     IUIThreadService uiThreadService,
     IBluetoothLEService bleService)
     : base(name, address, deviceRepository, uiThreadService, bleService)
 {
 }
Ejemplo n.º 17
0
 public DeviceManager(IDeviceRepository repo, IUserManager userManager, IFileSystem fileSystem, ILibraryMonitor libraryMonitor, IServerConfigurationManager config, ILogger logger, INetworkManager network)
 {
     _repo           = repo;
     _userManager    = userManager;
     _fileSystem     = fileSystem;
     _libraryMonitor = libraryMonitor;
     _config         = config;
     _logger         = logger;
     _network        = network;
 }
 public DevicesController(IMailService mailService, IDeviceRepository deviceRepository,
                          ICategoryRepository categoryRepository, IUserRepository userRepository,
                          IDeviceHistoryRepository historyRepository)
 {
     _mailService        = mailService;
     _deviceRepository   = deviceRepository;
     _categoryRepository = categoryRepository;
     _userRepository     = userRepository;
     _historyRepository  = historyRepository;
 }
Ejemplo n.º 19
0
        public SelectionDeviceViewOldModelDialog(IDeviceRepository deviceRepository)
        {
            _deviceRepository = deviceRepository;

            Task.Run(async() =>
            {
                ServerAddressCollection = new ObservableCollection <Device>(await _deviceRepository.GetDistincDevices());
            });
            Title = "Добавить";
        }
        public HomeController(IDeviceRepository deviceRepository,
            IPacketRepository packetRepository,
            IDeviceStateDocuments deviceStateDocuments,
            ILogDocuments logDocuments)
        {
            DeviceRepository = deviceRepository;
            PacketRepository = packetRepository;

            DeviceStateDocuments = deviceStateDocuments;
            LogDocuments = logDocuments;
        }
        public FifthplayDeviceConnector(IFifthplayRepository fifthplayRepository,
            ICredentialsRepository credentialsRepository, IDeviceRepository deviceRepository)
        {
            if (fifthplayRepository == null) throw new ArgumentNullException(nameof(fifthplayRepository));
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));

            _fifthplayRepository = fifthplayRepository;
            _credentialsRepository = credentialsRepository;
            _deviceRepository = deviceRepository;
        }
Ejemplo n.º 22
0
        public DeviceController(IDeviceRepository deviceRepository, IMeasurementUnitRepository measurementUnitRepository)
        {
            if (measurementUnitRepository == null)
                throw new System.ArgumentNullException(nameof(measurementUnitRepository));

            if (deviceRepository == null)
                throw new System.ArgumentNullException(nameof(deviceRepository));

            this.deviceRepository = deviceRepository;
            this.measurementUnitRepository = measurementUnitRepository;
        }
Ejemplo n.º 23
0
 public SelectionDeviceViewModelDialog(
     IDeviceRepository deviceRepository,
     IReportRepository reportRepository,
     IActiveDeviceRepository activeDeviceRepository)
 {
     _deviceRepository       = deviceRepository;
     _reportRepository       = reportRepository;
     _activeDeviceRepository = activeDeviceRepository;
     Title = "Создание архива";
     CreateNewReportCommand = new DelegateCommand(CreateNewReportHandler);
 }
Ejemplo n.º 24
0
 public PersonService(IPersonRepository personRepository, IDeviceRepository deviceRepository, ISessionRepository sessionRepository, IApplicationConfiguration applicationConfiguration)
 {
     _random            = new Random((int)DateTime.Now.Ticks);
     _personRepository  = personRepository;
     _deviceRepository  = deviceRepository;
     _sessionRepository = sessionRepository;
     //_notificationService = emailNotificationService;
     //_scheduledEmailService = scheduledEmailService;
     _applicationConfiguration = applicationConfiguration;
     //_scheduledEmailRepository = scheduledEmailRepository;
 }
Ejemplo n.º 25
0
        public CommandNotifier(
                  INewSessionNotifier sessionNotifier,
                  IDeviceRepository deviceRepository,
                  IUserRepository userRepository)
        {
            mDeviceRepository = deviceRepository;
            mUserRepository = userRepository;
            mNewSessionSessionNotifier = sessionNotifier;

            RegisterForNewSessions();
        }
Ejemplo n.º 26
0
 public GetDeviceHandler(
     IAccountRepository accountRepository,
     IAccountDeviceRepository accountDeviceRepository,
     IDeviceRepository deviceRepository,
     IHttpContextAccessor httpContextAccessor)
 {
     _accountRepository       = accountRepository;
     _accountDeviceRepository = accountDeviceRepository;
     _deviceRepository        = deviceRepository;
     _httpContextAccessor     = httpContextAccessor;
 }
Ejemplo n.º 27
0
 public BillsController(
     IBillRespository billRepository,
     IRoomRespository roomRespository,
     IDeviceRepository deviceRespository,
     ILogRepository logRespository)
 {
     this.billRepository    = billRepository;
     this.roomRespository   = roomRespository;
     this.deviceRespository = deviceRespository;
     this.logRespository    = logRespository;
 }
 public HomeController(IAreaRepository areaRepository, IDeviceRepository devRepository,
                       IUserRepository userRepository, IAppSettingRepository appSettingRepository, IAuditLogRepository auditLogRepository, ITransportPlanRepository transportPlanRepository)
     : base(areaRepository)
 {
     this.areaRepository          = areaRepository;
     this.devRepository           = devRepository;
     this.userRepository          = userRepository;
     this.appSettingRepository    = appSettingRepository;
     this.auditLogRepository      = auditLogRepository;
     this.transportPlanRepository = transportPlanRepository;
 }
 public FirstTimeUserExperienceTracker(IApplicationRepository applicationRepository, ILocationRepository locationRepository,
     IDeviceRepository deviceRepository, ICredentialsRepository credentialsRepository, IActionRepository actionRepository, 
     IIftttConnector iftttConnector)
 {
     _applicationRepository = applicationRepository;
     _locationRepository = locationRepository;
     _deviceRepository = deviceRepository;
     _credentialsRepository = credentialsRepository;
     _actionRepository = actionRepository;
     _iftttConnector = iftttConnector;
 }
Ejemplo n.º 30
0
        public HomeController(IDeviceRepository deviceRepository, ISecurityRepository securityRepository)
        {
            if (deviceRepository == null)
                throw new ArgumentNullException(nameof(deviceRepository));

            if (securityRepository == null)
                throw new ArgumentNullException(nameof(securityRepository));

            this.deviceRepository = deviceRepository;
            this.securityRepository = securityRepository;
        }
Ejemplo n.º 31
0
 public FirstTimeUserExperienceTracker(IApplicationRepository applicationRepository, ILocationRepository locationRepository,
                                       IDeviceRepository deviceRepository, ICredentialsRepository credentialsRepository, IActionRepository actionRepository,
                                       IIftttConnector iftttConnector)
 {
     _applicationRepository = applicationRepository;
     _locationRepository    = locationRepository;
     _deviceRepository      = deviceRepository;
     _credentialsRepository = credentialsRepository;
     _actionRepository      = actionRepository;
     _iftttConnector        = iftttConnector;
 }
Ejemplo n.º 32
0
 public ResourceOwnerPasswordValidator(
     UserManager <User> userManager,
     IDeviceRepository deviceRepository,
     IDeviceService deviceService,
     IUserService userService)
 {
     _userManager      = userManager;
     _deviceRepository = deviceRepository;
     _deviceService    = deviceService;
     _userService      = userService;
 }
Ejemplo n.º 33
0
 public DeviceManager(
     IBluetoothDeviceManager bluetoothDeviceManager,
     IInfraredDeviceManager infraredDeviceManager,
     IDeviceRepository deviceRepository,
     DeviceFactory deviceFactory)
 {
     _bluetoothDeviceManager = bluetoothDeviceManager;
     _infraredDeviceManager  = infraredDeviceManager;
     _deviceRepository       = deviceRepository;
     _deviceFactory          = deviceFactory;
 }
Ejemplo n.º 34
0
 public async Task <Result <DeviceRegistered> > Register(IDeviceRepository repository, IEventPublisher pub, string name)
 {
     return(await CreateDevice(name)
            .Map(repository.Save)
            .Map(s => new DeviceRegistered
     {
         Id = s.Id,
         Name = s.Name
     })
            .Map(pub.Raise));
 }
Ejemplo n.º 35
0
 public ConfigurationPort(
     IRepositoryContext <DeviceDb> repoContext,
     RegistrySettings registrySettings,
     IDeviceRepository deviceRepo,
     IApplicationRepository applicationRepo)
 {
     _repoContext      = repoContext;
     _registrySettings = registrySettings;
     _deviceRepo       = deviceRepo;
     _applicationRepo  = applicationRepo;
 }
Ejemplo n.º 36
0
 public DeviceService(ILookupService lookupService, IDeviceRepository deviceRepository, IKitTypeAttributeRepository kitTypeAttributeRepository
                      , IKitTypeRepository kitTypeRepository, IHardwareKitRepository hardwareKitRepository, LogHandler.Logger logger)
 {
     _logger                     = logger;
     _deviceRepository           = deviceRepository;
     _hardwareKitRepository      = hardwareKitRepository;
     _kitTypeAttributeRepository = kitTypeAttributeRepository;
     _kitTypeRepository          = kitTypeRepository;
     _lookupService              = lookupService;
     _iotConnectClient           = new IotConnectClient(SolutionConfiguration.BearerToken, SolutionConfiguration.Configuration.EnvironmentCode, SolutionConfiguration.Configuration.SolutionKey);
 }
Ejemplo n.º 37
0
 public DeviceController(IDeviceRepository deviceRepository,
                         IUnitOfWork unitOfWork,
                         ILogger <DeviceController> logger,
                         IMapper mapper,
                         IUrlHelper urlHelper)
 {
     deviceRepository1 = deviceRepository;
     unitOfWork1       = unitOfWork;
     logger1           = logger;
     mapper1           = mapper;
     urlHelper1        = urlHelper;
 }
        public IDeviceRepository GetDeviceRepository()
        {
            if (_deviceRepository == null)
            {
                var networkRepository = GetRepository(x => x.GetNetworkRepository());
                var scriptRepository  = GetRepository(x => x.GetScriptRepository());
                var taskRepository    = GetRepository(x => x.GetTaskRepository());
                _deviceRepository = new DeviceRepository(_connection, networkRepository, scriptRepository, taskRepository);
            }

            return(_deviceRepository);
        }
        public DevicesViewModel(IDeviceRepository deviceRepository, IRequestBus requestBus)
        {
            List <Device> devices = deviceRepository.GetAll();

            Devices = devices
                      .Select(x =>
            {
                PairingCommand pairingCommand = new PairingCommand(requestBus, x);
                return(new DeviceViewModel(x, pairingCommand));
            })
                      .ToList();
        }
Ejemplo n.º 40
0
 public DeviceAssignmentController(IMapper mapper,
                                   IAssignmentRepository repo,
                                   IAuthority auth,
                                   IDeviceRepository deviceRepo,
                                   IAssigneeRepository assigneeRepo)
 {
     _mapper       = mapper;
     _repo         = repo;
     _auth         = auth;
     _deviceRepo   = deviceRepo;
     _assigneeRepo = assigneeRepo;
 }
Ejemplo n.º 41
0
        public DeviceDeploymentViewModel(DeviceDeployer deployer, IDialogService dialogService,
                                         IDeviceRepository deviceRepository, OperationProgressViewModel operationProgress)
        {
            this.deployer         = deployer;
            this.dialogService    = dialogService;
            this.deviceRepository = deviceRepository;
            OperationProgress     = operationProgress;

            ConfigureCommands();

            IsBusyObservable = Deploy.IsExecuting;
        }
Ejemplo n.º 42
0
 private void SetRepository(IGroupRepository r, IDeviceTypeRepository dtr, IDeviceRepository dr,
                            IDeviceLogicalDeviceRepository or, SGMasterBaseEntities e)
 {
     _groupRepository = r;
     _groupRepository.SetEntities(e);
     _deviceTypeRepository = dtr;
     _deviceTypeRepository.SetEntities(e);
     _deviceRepository = dr;
     _deviceRepository.SetEntities(e);
     _deviceLogicalDeviceRepository = or;
     _deviceLogicalDeviceRepository.SetEntities(e);
 }
Ejemplo n.º 43
0
 public DeviceController(IDeviceRepository deviceRepository, IMapper mapper, IPropertyMappingService propertyMappingService,
                         IPropertyCheckerService propertyCheckerService)
 {
     _deviceRepository = deviceRepository ??
                         throw new ArgumentNullException(nameof(deviceRepository));
     _mapper = mapper ??
               throw new ArgumentNullException(nameof(mapper));
     _propertyMappingService = propertyMappingService ??
                               throw new ArgumentNullException(nameof(propertyMappingService));
     _propertyCheckerService = propertyCheckerService ??
                               throw new ArgumentNullException(nameof(propertyCheckerService));
 }
Ejemplo n.º 44
0
        public UnitOfWork(
            IDeviceRepository deviceRepository,
            IUserRepository userRepository,
            IIndicatorRepository indicatorRepository,
            IIndicatorValuesRepository indicatorValuesRepository)

        {
            DeviceRepository          = deviceRepository;
            UserRepository            = userRepository;
            IndicatorRepository       = indicatorRepository;
            IndicatorValuesRepository = indicatorValuesRepository;
        }
 public ResourceOwnerPasswordValidator(
     UserManager <User> userManager,
     IOptions <IdentityOptions> identityOptionsAccessor,
     IOptions <JwtBearerIdentityOptions> jwtIdentityOptionsAccessor,
     IDeviceRepository deviceRepository)
 {
     _userManager              = userManager;
     _identityOptions          = identityOptionsAccessor?.Value ?? new IdentityOptions();
     _jwtBearerIdentityOptions = jwtIdentityOptionsAccessor?.Value;
     _jwtBearerOptions         = Core.Identity.JwtBearerAppBuilderExtensions.BuildJwtBearerOptions(_jwtBearerIdentityOptions);
     _deviceRepository         = deviceRepository;
 }
Ejemplo n.º 46
0
        public CompositeDeviceClientConnectionManager(ILoggerFactory loggerFactory, IConfiguration config, IDeviceRepository repository, IClock clock, ILogger <CompositeDeviceClientConnectionManager> logger)
        {
            this.deviceRepository = repository;
            this.logger           = logger;

            logger.LogInformation("***************CompositeDeviceClientConnectionManager created");
            factory            = new MqttFactory();
            deviceClients      = new Dictionary <string, CompositeDeviceClient>();
            this.Configuration = config;
            this.loggerFactory = loggerFactory;
            this.clock         = clock;
        }
Ejemplo n.º 47
0
 private void SetRepository(IDeviceObjectRepository r, IDeviceRepository dr, IDeviceTypeRepository dtr,
                            ICosemObjectRepository cor, SGMasterBaseEntities e)
 {
     _deviceObjectRepository = r;
     _deviceObjectRepository.SetEntities(e);
     _deviceRepository = dr;
     _deviceRepository.SetEntities(e);
     _deviceTypeRepository = dtr;
     _deviceTypeRepository.SetEntities(e);
     _cosemObjectRepository = cor;
     _cosemObjectRepository.SetEntities(e);
 }
Ejemplo n.º 48
0
        public MainViewModel(IApplicationRepository applicationRepository, IFunctionalityToggler functionalityToggler, ILogRepository logRepository,
            ILocationRepository locationRepository, IDeviceRepository deviceRepository, ICredentialsRepository credentialsRepository,
            IFirstTimeUserExperienceTracker firstTimeUserExperienceTracker, IActionRepository actionRepository)
        {
            if (applicationRepository == null) throw new ArgumentNullException(nameof(applicationRepository));
            if (functionalityToggler == null) throw new ArgumentNullException(nameof(functionalityToggler));
            if (logRepository == null) throw new ArgumentNullException(nameof(logRepository));
            if (locationRepository == null) throw new ArgumentNullException(nameof(locationRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));
            if (actionRepository == null) throw new ArgumentNullException(nameof(actionRepository));
            if (credentialsRepository == null) throw new ArgumentNullException(nameof(credentialsRepository));
            if (firstTimeUserExperienceTracker == null) throw new ArgumentNullException(nameof(firstTimeUserExperienceTracker));

            _applicationRepository = applicationRepository;
            _functionalityToggler = functionalityToggler;
            _logRepository = logRepository;
            _locationRepository = locationRepository;
            _deviceRepository = deviceRepository;
            _actionRepository = actionRepository;
            _credentialsRepository = credentialsRepository;
            _firstTimeUserExperienceTracker = firstTimeUserExperienceTracker;

            if (IsInDesignMode)
            {
                IsFirstTimeUserExperience = false;

                Activities = new ObservableCollection<ActivityViewModel>
                {
                    new ActivityViewModel(DateTimeOffset.UtcNow, "Home")
                    {
                        Actions = new List<string> { "switch on Desk lamp", $"Failed to control IFTTT{Environment.NewLine}This is what happened: (NotFound Not Found..." }
                    },
                    new ActivityViewModel(DateTimeOffset.UtcNow.AddDays(-1), "Away")
                    {
                        Actions = new List<string> { "switch off TV", "set to 16°C heating" }
                    },
                    new ActivityViewModel(DateTimeOffset.UtcNow.AddDays(-10), "Home")
                    {
                        Actions = new List<string> { "switch on TV", "set to 16°C heating" }
                    }
                };

                IsFirstTimeUserExperienceHomeStep = true;
            }
            else
            {
                Activities = new ObservableCollection<ActivityViewModel>();
            }

            UpdateFirstTimeUserExperienceCommand = new TransactionalCommandTask(UpdateFirstTimeUserExperience);
            NavigateToSettingsCommand = new RelayCommand(NavigateToSettings);
        }
Ejemplo n.º 49
0
        public DeviceModule(ILogger logger, IDeviceRepository deviceRepository, IDocumentSession documentSession)
            : base("/devices")
        {
            Get["/"] = p =>
            {
                var registeredDevices = deviceRepository.GetAll();
                var registeredDeviceDtos = Mapper.Map<IEnumerable<RegisteredDeviceDto>>(registeredDevices);
                return Response.AsJson(registeredDeviceDtos);
            };

            Post["/"] = p =>
            {
                var newDeviceRequest = this.Bind<DeviceSetupRequest>();

                var registeredDevice = new RegisteredDevice(newDeviceRequest.DeviceName, newDeviceRequest.DeviceType, newDeviceRequest.IpAddress);
                deviceRepository.Add(registeredDevice);

                documentSession.SaveChanges();
                documentSession.Dispose();

                return HttpStatusCode.OK;
            };

            Post["/{name}/{commandRoute}"] = p =>
            {
                Response response = HttpStatusCode.NotFound;

                //Lookup IP address and device type from device
                //TODO: Implement singleton DeviceMap object to cache and return this data
                var device = deviceRepository.FindByName(p.name);

                if (device != null)
                {
                    var commandRoute = String.Format("/{0}/{1}", device.Type, p.commandRoute);
                    response = new Response();
                    response.Headers.Add("cmd-route", commandRoute);
                    response.Headers.Add("cmd-ip", device.IpAddress);
                    response.StatusCode = HttpStatusCode.OK;

                    logger.Info(String.Format("Recievied the {0} command for the {1}.  Routing it to {2}", p.commandRoute, p.device, commandRoute));
                }

                return response;
            };

            Delete["/{name}"] = p =>
            {
                Response response = HttpStatusCode.NotFound;

                return response;
            };
        }
Ejemplo n.º 50
0
        public PushSharpPushService(
            IDeviceRepository deviceRepository,
            ILogger<IPushService> logger,
            CurrentContext currentContext,
            IHostingEnvironment hostingEnvironment,
            GlobalSettings globalSettings)
        {
            _deviceRepository = deviceRepository;
            _logger = logger;
            _currentContext = currentContext;

            InitGcmBroker(globalSettings);
            InitApnsBroker(globalSettings, hostingEnvironment);
        }
Ejemplo n.º 51
0
 private void SetUpRepositories()
 {
     ContractorRepository = kernel.Get<IContractorRepository>();
     DeviceRepository = kernel.Get<IDeviceRepository>();
     FixedAssetRepository = kernel.Get<IFixedAssetRepository>();
     KindRepository = kernel.Get<IKindRepository>();
     LicenceRepository = kernel.Get<ILicenceRepository>();
     PeripheralDeviceRepository = kernel.Get<IPeripheralDeviceRepository>();
     PersonRepository = kernel.Get<IPersonRepository>();
     SectionRepository = kernel.Get<ISectionRepository>();
     SubgroupRepository = kernel.Get<ISubgroupRepository>();
     MembershipRoleRepository = kernel.Get<IMembershipRoleRepository>();
     MembershipUserRepository = kernel.Get<IMembershipUserRepository>();
 }
 public DeviceService(IDeviceRepository deviceRepository, IErrorRepository errorRepository,
     IEventRepository eventRepository, ICrashRepository crashRepository, IFeedbackRepository feedbackRepository,
     ISystemErrorRepository systemErrorRepository, IAppUserRepository appUserRepository,
      AppActs.Repository.Interface.IApplicationRepository applicationRepository, AppActs.API.Model.Settings settings)
 {
     this.deviceRepository = deviceRepository;
     this.errorRepository = errorRepository;
     this.eventRepository = eventRepository;
     this.crashRepository = crashRepository;
     this.feedbackRepository = feedbackRepository;
     this.systemErrorRepository = systemErrorRepository;
     this.appUserRepository = appUserRepository;
     this.applicationRepository = applicationRepository;
     this.settings = settings;
 }
Ejemplo n.º 53
0
        public GroupPage(GroupViewModel groupViewModel = null, IUserRepository userRepository = null, IGroupRepository groupRepository = null, IDeviceRepository deviceRepository = null)
        {
            _groupViewModel = groupViewModel;
            BindingContext = this;
            _devices = new ObservableCollection<DeviceViewModel>();

            _userRepository = userRepository ?? DependencyService.Get<IUserRepository>();
            _groupRepository = groupRepository ?? DependencyService.Get<IGroupRepository>();
            _deviceRepository = deviceRepository ?? DependencyService.Get<IDeviceRepository>();

            _notifyPage = new NotifyPage(this);

            InitializeComponent();

            DevicesListView.ItemsSource = _devices;
        }
 public StructuresController(IDeviceRepository deviceRepository,
     ISignboardRepository signboardRepository,
     ISlideshowRepository slideshowRepository,
     IWidgetDefinitionRepository widgetDefinitionRepository,
     IAnnouncementRepository announcementRepository,
     IDiagnosticsComponent diagnosticsComponent,
     ILoggingComponent loggingComponent)
 {
     DeviceRepository = deviceRepository;
     SignboardRepository = signboardRepository;
     SlideshowRepository = slideshowRepository;
     WidgetDefinitionRepository = widgetDefinitionRepository;
     AnnouncementRepository = announcementRepository;
     DiagnosticsComponent = diagnosticsComponent;
     LoggingComponent = loggingComponent;
 }
Ejemplo n.º 55
0
 public JwtBearerSignInManager(
     UserManager<User> userManager,
     IHttpContextAccessor contextAccessor,
     IUserClaimsPrincipalFactory<User> claimsFactory,
     IOptions<IdentityOptions> optionsAccessor,
     IOptions<JwtBearerIdentityOptions> jwtIdentityOptionsAccessor,
     IOptions<JwtBearerOptions> jwtOptionsAccessor,
     ILogger<JwtBearerSignInManager> logger,
     IDeviceRepository deviceRepository)
 {
     UserManager = userManager;
     Context = contextAccessor.HttpContext;
     ClaimsFactory = claimsFactory;
     IdentityOptions = optionsAccessor?.Value ?? new IdentityOptions();
     JwtIdentityOptions = jwtIdentityOptionsAccessor?.Value ?? new JwtBearerIdentityOptions();
     JwtBearerOptions = jwtOptionsAccessor?.Value ?? new JwtBearerOptions();
     _deviceRepository = deviceRepository;
 }
Ejemplo n.º 56
0
        public DevicePage(DeviceViewModel device, IDeviceRepository deviceRepository = null, IRealTimeService realTimeService = null)
        {
            _deviceViewModel = device;
            _deviceRepository = deviceRepository ?? DependencyService.Get<IDeviceRepository>();
            _realTimeService = realTimeService ?? DependencyService.Get<IRealTimeService>();
            _notifyPage = new NotifyPage(this);
            _realTimeService.DeviceUpdated += RealTimeService_DeviceUpdated;

            BindingContext = _deviceViewModel;

            InitializeComponent();

            if (device.DeviceType == DeviceType.AutomaticWindow || device.DeviceType == DeviceType.Thermostat)
                ChangeSettingButton.IsVisible = true;

            if (device.DeviceType == DeviceType.Thermostat)
                ContinousSettingEntry.IsVisible = true;

        }
        public ConfigureActionViewModel(IDeviceRepository deviceRepository, 
            IActionTypeRepository actionTypeRepository, IActionRepository actionRepository, IActionUpdater actionUpdater)
        {
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));
            if (actionTypeRepository == null) throw new ArgumentNullException(nameof(actionTypeRepository));
            if (actionRepository == null) throw new ArgumentNullException(nameof(actionRepository));
            if (actionUpdater == null) throw new ArgumentNullException(nameof(actionUpdater));

            _deviceRepository = deviceRepository;
            _actionTypeRepository = actionTypeRepository;
            _actionRepository = actionRepository;
            _actionUpdater = actionUpdater;

            ActionTriggers = new ObservableCollection<ActionTrigger>();
            Devices = new ObservableCollection<Device>();
            ActionTypes = new ObservableCollection<ActionType>();
            ActionArguments = new ObservableCollection<ActionArgument>();
            SaveCommand = new TransactionalCommandTask(Save, CanSave);

            MessengerInstance.Register<TasksUpdated>(this, t => ActionIdentifier = null);
        }
Ejemplo n.º 58
0
        public SettingsViewModel(IFunctionalityToggler functionalityToggler,
            IApplicationRepository applicationRepository, ILocationRepository locationRepository, IDeviceRepository deviceRepository)
        {
            if (functionalityToggler == null) throw new ArgumentNullException(nameof(functionalityToggler));
            if (applicationRepository == null) throw new ArgumentNullException(nameof(applicationRepository));
            if (locationRepository == null) throw new ArgumentNullException(nameof(locationRepository));
            if (deviceRepository == null) throw new ArgumentNullException(nameof(deviceRepository));

            _functionalityToggler = functionalityToggler;
            _applicationRepository = applicationRepository;
            _locationRepository = locationRepository;
            _deviceRepository = deviceRepository;

            EnableCommand = new TransactionalCommandTask(Enable, () => CanExecute);
            EnableCommand.CanExecuteChanged += (s, e) => CanExecute = !EnableCommand.IsExecuting;

            CanExecute = true;
            
            if (IsInDesignMode)
                IsEnabled = true;

            MessengerInstance.Register<HomeLocationChanged>(this, async t => await DispatcherHelper.RunAsync(() => IsHomeLocationSet = true));
        }
 public DeviceController(IDeviceRepository repo)
 {
     repository = repo;
 }
 /// <summary>
 /// Default constructor
 /// </summary>
 /// <param name="deviceRepository">IDeviceRepository implementation</param>
 public DeviceStatusNotificationHandler(IDeviceRepository deviceRepository)
 {
     _deviceRepository = deviceRepository;
 }