示例#1
0
        public AreaService(
            IComponentService componentService,
            IAutomationService automationService,
            ISystemEventsService systemEventsService,
            ISystemInformationService systemInformationService,
            IApiService apiService,
            ISettingsService settingsService)
        {
            if (componentService == null) throw new ArgumentNullException(nameof(componentService));
            if (automationService == null) throw new ArgumentNullException(nameof(automationService));
            if (systemEventsService == null) throw new ArgumentNullException(nameof(systemEventsService));
            if (systemInformationService == null) throw new ArgumentNullException(nameof(systemInformationService));
            if (apiService == null) throw new ArgumentNullException(nameof(apiService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            _componentService = componentService;
            _automationService = automationService;
            _apiService = apiService;
            _settingsService = settingsService;

            systemEventsService.StartupCompleted += (s, e) =>
            {
                systemInformationService.Set("Areas/Count", _areas.GetAll().Count);
            };

            apiService.ConfigurationRequested += HandleApiConfigurationRequest;
        }
示例#2
0
            public Configuration(
                CCToolsBoardService ccToolsBoardService, 
                IPi2GpioService pi2GpioService, 
                SynonymService synonymService,
                IDeviceService deviceService,
                II2CBusService i2CBusService, 
                ISchedulerService schedulerService, 
                RemoteSocketService remoteSocketService, 
                IApiService apiService,
                IContainer containerService)
            {
                if (ccToolsBoardService == null) throw new ArgumentNullException(nameof(ccToolsBoardService));
                if (pi2GpioService == null) throw new ArgumentNullException(nameof(pi2GpioService));
                if (synonymService == null) throw new ArgumentNullException(nameof(synonymService));
                if (deviceService == null) throw new ArgumentNullException(nameof(deviceService));
                if (i2CBusService == null) throw new ArgumentNullException(nameof(i2CBusService));
                if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
                if (remoteSocketService == null) throw new ArgumentNullException(nameof(remoteSocketService));
                if (apiService == null) throw new ArgumentNullException(nameof(apiService));
                if (containerService == null) throw new ArgumentNullException(nameof(containerService));

                _ccToolsBoardService = ccToolsBoardService;
                _pi2GpioService = pi2GpioService;
                _synonymService = synonymService;
                _deviceService = deviceService;
                _i2CBusService = i2CBusService;
                _schedulerService = schedulerService;
                _remoteSocketService = remoteSocketService;
                _apiService = apiService;
                _containerService = containerService;
            }
        public NotificationService(
            IDateTimeService dateTimeService, 
            IApiService apiService, 
            ISchedulerService schedulerService, 
            ISettingsService settingsService,
            IStorageService storageService,
            IResourceService resourceService)
        {
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));
            if (apiService == null) throw new ArgumentNullException(nameof(apiService));
            if (schedulerService == null) throw new ArgumentNullException(nameof(schedulerService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));
            if (storageService == null) throw new ArgumentNullException(nameof(storageService));
            if (resourceService == null) throw new ArgumentNullException(nameof(resourceService));

            _dateTimeService = dateTimeService;
            _storageService = storageService;
            _resourceService = resourceService;

            settingsService.CreateSettingsMonitor<NotificationServiceSettings>(s => Settings = s);

            apiService.StatusRequested += HandleApiStatusRequest;

            schedulerService.RegisterSchedule("NotificationCleanup", TimeSpan.FromMinutes(15), Cleanup);
        }
 public ManufacturingService(IStaticDataService staticService, IApiService apiService, IBlueprintRepository blueprintRepository, IToDoListRepository todoRepository)
 {
     _staticService = staticService;
     _apiService = apiService;
     _blueprintRepository = blueprintRepository;
     _todoRepository = todoRepository;
 }
示例#5
0
      protected override void OnCreate (Bundle bundle)
      {
         AppSettings.TrackingId = "UA-65892866-1";
         AppSettings.RegisterTypes ();

         Logger.Instance = new AndroidLogger ();
         Mvx.RegisterType<IToastService, ToastService> ();
         Mvx.RegisterType<IAnalyticsService, AnalyticsService> ();

         base.OnCreate (bundle);

         SetContentView (Resource.Layout.Main);

         _apiService = Mvx.Resolve<IApiService> ();
         _toastService = Mvx.Resolve<IToastService> ();
         _loginService = Mvx.Resolve<ILoginService> ();

         IsLoading = true;
         CheckUserExists ();

         Button button = FindViewById<Button> (Resource.Id.button_register);

         button.Click += ClickHandler;

         AppLocation.Current.LocationServiceConnected += (object sender, ServiceConnectedEventArgs e) => {
         };
         AppLocation.StartLocationService ();
      }
示例#6
0
 public SyncService(IApiService apiService, ISettingService settingService, IRepository<ReleaseJoke> releaseJokeRepository, IRepository<NewJoke> newJokeRepository)
 {
     ApiService = apiService;
     ReleaseJokeRepository = releaseJokeRepository;
     NewJokeRepository = newJokeRepository;
     SettingService = settingService;
 }
        public LocalHttpServerApiDispatcherEndpointService(IApiService apiService, HttpServer httpServer)
        {
            if (apiService == null) throw new ArgumentNullException(nameof(apiService));
            if (httpServer == null) throw new ArgumentNullException(nameof(httpServer));

            _apiService = apiService;
            _httpServer = httpServer;
        }
示例#8
0
 public AppService(
     INotificationService notificationService,
     IUserDataRepository userDataRepository,
     IApiService apiService)
 {
     _notificationService = notificationService;
     _userDataRepository = userDataRepository;
     _apiService = apiService;
 }
        public LPD433MHzSignalSender(I2CHardwareBridge.I2CHardwareBridge i2CHardwareBridge, byte pin, IApiService apiController)
        {
            if (i2CHardwareBridge == null) throw new ArgumentNullException(nameof(i2CHardwareBridge));
            if (apiController == null) throw new ArgumentNullException(nameof(apiController));

            _i2CHardwareBridge = i2CHardwareBridge;
            _pin = pin;

            apiController.Route("433MHz", ApiPost);
        }
示例#10
0
        public StatusService(IComponentService componentService, IApiService apiService, ISettingsService settingsService)
        {
            if (componentService == null) throw new ArgumentNullException(nameof(componentService));
            if (apiService == null) throw new ArgumentNullException(nameof(apiService));
            if (settingsService == null) throw new ArgumentNullException(nameof(settingsService));

            _componentService = componentService;
            _settingsService = settingsService;

            apiService.StatusRequested += ExposeStatus;
        }
        public WeatherService(IDateTimeService dateTimeService, IApiService apiService)
        {
            if (dateTimeService == null) throw new ArgumentNullException(nameof(dateTimeService));

            _dateTimeService = dateTimeService;

            apiService.StatusRequested += (s, e) =>
            {
                e.Context.Response.Merge(JObject.FromObject(this));
            };
        }
示例#12
0
        public SecuredPagesModule(DataStore data, IApiService api, IDeploymentService deploy)
        {
            _Data = data;
            _Api = api;
            _Deploy = deploy;
            Before.AddItemToEndOfPipeline(CheckAuth);

            Get["/Sites"] = Sites;
            Put["/Sites/{slug}/Notifications/Email"] = EnableEmailNotification;
            Get["/Deploy/{key}"] = Deploy;
            Post["/Deploy/{key}"] = DoDeploy;
        }
示例#13
0
 public UpdateService(IApiService apiService, IToDoListRepository todoRepository, IStaticDataService staticService, IIndustryJobUpdateService indyService, IAssetUpdateService assetUpdate, IInventionService inventionService, IManufacturingService manufacturingService, IMarketOrderUpdateService marketService, ITransactionService transactionService)
 {
     _apiService = apiService;
     _todoRepository = todoRepository;
     _staticService = staticService;
     _indyService = indyService;
     _assetUpdate = assetUpdate;
     _inventionService = inventionService;
     _manufacturingService = manufacturingService;
     _marketService = marketService;
     _transactionService = transactionService;
 }
 public HandsOnTableController(
     IOrchardServices services,
     ITransformalizeService transformalize,
     IApiService apiService
 )
     : base(transformalize) {
     _orchardServices = services;
     _apiService = apiService;
     _query.Add("format", "json");
     _query.Add("flavor", "arrays");
     _query.Add("mode", "default");
 }
 public SlickGridController(
     IOrchardServices services,
     ITransformalizeService transformalize,
     IApiService apiService
 )
     : base(transformalize) {
     _orchardServices = services;
     _apiService = apiService;
     _query.Add("format", "json");
     _query.Add("flavor", "objects");
     _query.Add("mode", "default");
 }
        public TestViewModel(INotifications notifications, IApiService service)
        {
            _notifications = notifications;
            _service = service;

            _notifications.Registered += Registered;
            _notifications.Unregistered += UnRegistered;

            RegistrationId = _notifications.RegistrationId;
            if (!string.IsNullOrEmpty(RegistrationId))
                _service.TellApiAboutRegistrationAsync(RegistrationId);
        }
示例#17
0
 public MainWindow()
 {
     var service = new ApiService();
     _apiService = service;
     Cef.Initialize(new CefSettings()
     {
         CachePath = service.CachePath,
         LogFile = service.LogFile
     }, true, true);
     InitializeComponent();
     collector = new ClientDataCollector(_apiService);
     selfHostedBrowser.RegisterJsObject(nameof(ClientDataCollector), collector);
 }
示例#18
0
 public ApiController(
     ITransformalizeService transformalize,
     IApiService apiService,
     IExtensionManager extensionManager,
     IJobsQueueService jobQueueService
 ) {
     _stopwatch.Start();
     _transformalize = transformalize;
     _apiService = apiService;
     _jobQueueService = jobQueueService;
     _moduleVersion = extensionManager.GetExtension("Transformalize.Orchard").Version;
     T = NullLocalizer.Instance;
     Logger = NullLogger.Instance;
 }
        public PivotViewModel(IApiService apiService)
        {
            var api = apiService;

            Dates = new ObservableCollection<DateViewModel>
            {
                new DateViewModel(api),
                new DateViewModel(api),
                new DateViewModel(api),
                new DateViewModel(api),
                new DateViewModel(api),
                new DateViewModel(api),
                new DateViewModel(api),
            };

            foreach (var daysFromToday in Enumerable.Range(0, Dates.Count))
            {
                Dates[daysFromToday].Initiate(DateTime.Today.AddDays(daysFromToday));
            }
        }
        public void SetUp()
        {
            _blueprints = TestHelpers.GetData<List<BlueprintInfo>>(typeof(BlueprintInfo).ToString());
            _productTypes = TestHelpers.GetData<List<ProductType>>(typeof(ProductType).ToString());

            var staticMock = new Mock<IStaticRepository>();
            staticMock.Setup(p => p.GetAllAsync<BlueprintInfo>()).ReturnsAsync(_blueprints);
            staticMock.Setup(p => p.GetAllAsync<ProductType>()).ReturnsAsync(_productTypes);

            var staticService = new StaticDataService(staticMock.Object);

            var apiMock = new Mock<IApiRepository>();
            apiMock.Setup(p => p.GetMarketStatisticsAsync(It.IsAny<List<int>>(), It.IsAny<int>())).Returns(DummyPrices());
            apiMock.Setup(p => p.GetApiData<BlueprintApi>(It.IsAny<Credential>(), CallContext.Corp, CallEndPoint.Blueprints)).Returns(CreateDummyBlueprints());
            _apiService = new EveApi.ApiService(apiMock.Object);

            var todoMock = new Mock<IToDoListRepository>();

            var manufacturingService = new ManufacturingService(staticService, _apiService, new BlueprintRepository(_apiService, todoMock.Object), todoMock.Object);

            _inventionService = new InventionService(_apiService, manufacturingService, staticService);
        }
示例#21
0
 public EventsService (IApiService apiService)
 {
     _apiService = apiService;
 }
示例#22
0
        public async Task <IActionResult> Delete(int id)
        {
            await IApiService.DeleteProduct(id);

            return(RedirectToAction("Index", "Product"));
        }
 public WorkspaceService(IApiService srv)
 {
     ToggleSrv = srv;
 }
示例#24
0
 public TranslateController(IApiService apiService)
 {
     _apiService = apiService;
 }
示例#25
0
        public async Task <IActionResult> CreateProduct(Product product)
        {
            await IApiService.InsertProduct(product);

            return(RedirectToAction("Index", "Product"));
        }
示例#26
0
 public MessageController(IApiService service, IAttachmentCreator attachmentCreator, IValidationManager validationManager)
 {
     _service           = service;
     _attachmentCreator = attachmentCreator;
     _validationManager = validationManager;
 }
示例#27
0
 public ReportService(IApiService srv)
 {
     ToggleSrv = srv;
 }        
示例#28
0
 public UpdateDelegateJob(ILogger <UpdateDelegateJob> logger, IApiService apiService)
 {
     _logger     = logger;
     _apiService = apiService;
 }
示例#29
0
 public LeadsService(IApiService apiService, ICacheService cacheService)
 {
     _apiService   = apiService;
     _cacheService = cacheService;
 }
 /// <summary>
 /// Contructor de la clase
 /// </summary>
 /// <param name="apiService"></param>
 public CarService(IApiService apiService)
 {
     _apiService = apiService;
 }
示例#31
0
 public ClosedPredictionsForTournamentPageViewModel(INavigationService navigationService, IApiService apiService)
     : base(navigationService)
 {
     _apiService = apiService;
     Title       = Languages.Closed;
 }
 public UserService(IAuthorizationService authorization, IApiService api)
 {
     _authorization = authorization;
     _api           = api;
 }
示例#33
0
 public SignInViewModel(IMvxNavigationService navigationService, IDialogService dialogService, IApiService apiService) : base(navigationService, dialogService)
 {
     _apiService = apiService;
     //this.UserName = "******";
     //this.Password = "******";
 }
示例#34
0
 public ClientService(IApiService srv)
 {
     TogglSrv = srv;
 }
示例#35
0
		public RemoteDataService (IApiService apiService)
		{
			this._apiService = apiService;
			
		}
示例#36
0
 public MehrnewsReaderService(IApiService apiService, ILogger <MehrnewsReaderService> logger)
 {
     _apiService = apiService;
     _logger     = logger;
 }
示例#37
0
 public UserController(IApiService <UserVm> apiService) : base(apiService)
 {
 }
示例#38
0
 public DeploymentService(IApiService api, DataStore data)
 {
     _Api = api;
     _Data = data;
 }
示例#39
0
 public SitesViewModel(IApiService api, ISession session)
     : base("Sites", session)
 {
     Sites = api.GetApplications().Select(d => Application.CreateFromAPI(d)).OrderBy(d => d.Name.ToLowerInvariant()).ToList();
 }
示例#40
0
 public AlertInviteViewModel(IApiService apiService, ICacheService cacheService, IMessageboxService messageboxService, IProgressDialogService progressDialogService, IPlatformService platformService)
     : base(apiService, cacheService, messageboxService, progressDialogService, platformService)
 {
 }
示例#41
0
        public async Task <IActionResult> New(int id)
        {
            ViewBag.Categories = await IApiService.GetCategories();

            return(View());
        }
示例#42
0
 public CriancasViewModel()
 {
     Criancas   = new ObservableCollection <Criancas>();
     apiService = new ApiService(http);
 }
示例#43
0
 public NewsService (IApiService apiService)
 {
     _apiService = apiService;
 }
示例#44
0
        public AuthService(
            ICryptoService cryptoService,
            IApiService apiService,
            IUserService userService,
            ITokenService tokenService,
            IAppIdService appIdService,
            II18nService i18nService,
            IPlatformUtilsService platformUtilsService,
            IMessagingService messagingService,
            IVaultTimeoutService vaultTimeoutService,
            bool setCryptoKeys = true)
        {
            _cryptoService        = cryptoService;
            _apiService           = apiService;
            _userService          = userService;
            _tokenService         = tokenService;
            _appIdService         = appIdService;
            _i18nService          = i18nService;
            _platformUtilsService = platformUtilsService;
            _messagingService     = messagingService;
            _vaultTimeoutService  = vaultTimeoutService;
            _setCryptoKeys        = setCryptoKeys;

            TwoFactorProviders = new Dictionary <TwoFactorProviderType, TwoFactorProvider>();
            TwoFactorProviders.Add(TwoFactorProviderType.Authenticator, new TwoFactorProvider
            {
                Type     = TwoFactorProviderType.Authenticator,
                Priority = 1,
                Sort     = 1
            });
            TwoFactorProviders.Add(TwoFactorProviderType.YubiKey, new TwoFactorProvider
            {
                Type     = TwoFactorProviderType.YubiKey,
                Priority = 3,
                Sort     = 2,
                Premium  = true
            });
            TwoFactorProviders.Add(TwoFactorProviderType.Duo, new TwoFactorProvider
            {
                Type     = TwoFactorProviderType.Duo,
                Name     = "Duo",
                Priority = 2,
                Sort     = 3,
                Premium  = true
            });
            TwoFactorProviders.Add(TwoFactorProviderType.OrganizationDuo, new TwoFactorProvider
            {
                Type     = TwoFactorProviderType.OrganizationDuo,
                Name     = "Duo (Organization)",
                Priority = 10,
                Sort     = 4
            });
            TwoFactorProviders.Add(TwoFactorProviderType.U2f, new TwoFactorProvider
            {
                Type     = TwoFactorProviderType.U2f,
                Priority = 4,
                Sort     = 5,
                Premium  = true
            });
            TwoFactorProviders.Add(TwoFactorProviderType.Email, new TwoFactorProvider
            {
                Type     = TwoFactorProviderType.Email,
                Priority = 0,
                Sort     = 6,
            });
        }
示例#45
0
        public async Task <IActionResult> Index()
        {
            ViewBag.products = await IApiService.GetProducts();

            return(View());
        }
示例#46
0
 public StateService(IApiService api)
 {
     this.api = api;
     User = new UserModel();
 }
示例#47
0
		public RefitApiService(IApiService apiService)
		{
			_apiService = apiService;
		}
示例#48
0
 public TodoController(IApiService <TodoItem> apiService) : base(apiService)
 {
 }
 public ContactDataService(IApiService apiService)
 {
     _apiService = apiService;
 }
示例#50
0
 public Vendor1ServiceWrapper(IApiService apiService, IVendorUrlProvider urlProvider, IVendorCredentialsProvider credentialProvider)
     : base(apiService, urlProvider, credentialProvider, new Mocks.LoggerMock <Vendor1Service>())
 {
 }
示例#51
0
 public TransactionService(IApiService apiService, IToDoListRepository todoRepository)
 {
     _apiService = apiService;
     _todoRepository = todoRepository;
 }
示例#52
0
 public ClustersController(IDataService dataService, IApiService apiService) : base(dataService, apiService)
 {
 }
示例#53
0
 public FerroviarioMasterDetailPageViewModel(INavigationService navigationService, IApiService apiService) : base(navigationService)
 {
     _instance          = this;
     _apiService        = apiService;
     _navigationService = navigationService;
     LoadUser();
     LoadMenus();
 }
示例#54
0
 public StoreController(IApiService api, IMapper mapper, ICacheService cache) : base(api, mapper, cache)
 {
 }
 public TimeEntryService(IApiService srv)
 {
     ToggleSrv = srv;
 }
 public PropertiesController(IApiService apiService)
 {
     _api = apiService;
 }
示例#57
0
 /// <summary>
 ///     Constructor que inyecta el servicio de la API y la configuración cargada en el fichero "appsettings.json"
 /// </summary>
 /// <param name="apiService">El servicio de la API de la cual va a consumir</param>
 /// <param name="config">El fichero de configuración "appsettings.json"</param>
 /// <param name="cache">La caché en memoria</param>
 public LiveByCountryAndStatusAfterDateController(IApiService apiService, IConfiguration config, ICovid19MemoryCacheService cache) : base(apiService, config, cache)
 {
     _apiService = apiService;
     _config     = config;
     _cache      = cache;
 }
示例#58
0
 public SetLocationCommand(ITelegramBotClient bot, IStateRepository states, MessageConstants constants, IApiService api)
 {
     _bot       = bot;
     _states    = states;
     _constants = constants;
     _api       = api;
 }
示例#59
0
 public TaskService(IApiService srv)
 {
     ToggleSrv = srv;
 }
示例#60
0
 public FileService(IApiService ApiService, ISearchService SearchService)
     : base(ApiService, SearchService, "/api/1.0/files")
 {
 }