Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
 public ManufacturingService(IStaticDataService staticService, IApiService apiService, IBlueprintRepository blueprintRepository, IToDoListRepository todoRepository)
 {
     _staticService = staticService;
     _apiService = apiService;
     _blueprintRepository = blueprintRepository;
     _todoRepository = todoRepository;
 }
Ejemplo n.º 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 ();
      }
Ejemplo n.º 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;
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 11
0
        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));
            };
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 14
0
 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);
        }
Ejemplo n.º 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);
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 19
0
        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));
            }
        }
Ejemplo n.º 20
0
        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);
        }
Ejemplo n.º 21
0
 public EventsService (IApiService apiService)
 {
     _apiService = apiService;
 }
Ejemplo n.º 22
0
        public async Task <IActionResult> Delete(int id)
        {
            await IApiService.DeleteProduct(id);

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

            return(RedirectToAction("Index", "Product"));
        }
Ejemplo n.º 26
0
 public MessageController(IApiService service, IAttachmentCreator attachmentCreator, IValidationManager validationManager)
 {
     _service           = service;
     _attachmentCreator = attachmentCreator;
     _validationManager = validationManager;
 }
Ejemplo n.º 27
0
 public ReportService(IApiService srv)
 {
     ToggleSrv = srv;
 }        
Ejemplo n.º 28
0
 public UpdateDelegateJob(ILogger <UpdateDelegateJob> logger, IApiService apiService)
 {
     _logger     = logger;
     _apiService = apiService;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 31
0
 public ClosedPredictionsForTournamentPageViewModel(INavigationService navigationService, IApiService apiService)
     : base(navigationService)
 {
     _apiService = apiService;
     Title       = Languages.Closed;
 }
Ejemplo n.º 32
0
 public UserService(IAuthorizationService authorization, IApiService api)
 {
     _authorization = authorization;
     _api           = api;
 }
Ejemplo n.º 33
0
 public SignInViewModel(IMvxNavigationService navigationService, IDialogService dialogService, IApiService apiService) : base(navigationService, dialogService)
 {
     _apiService = apiService;
     //this.UserName = "******";
     //this.Password = "******";
 }
Ejemplo n.º 34
0
 public ClientService(IApiService srv)
 {
     TogglSrv = srv;
 }
Ejemplo n.º 35
0
		public RemoteDataService (IApiService apiService)
		{
			this._apiService = apiService;
			
		}
Ejemplo n.º 36
0
 public MehrnewsReaderService(IApiService apiService, ILogger <MehrnewsReaderService> logger)
 {
     _apiService = apiService;
     _logger     = logger;
 }
Ejemplo n.º 37
0
 public UserController(IApiService <UserVm> apiService) : base(apiService)
 {
 }
Ejemplo n.º 38
0
 public DeploymentService(IApiService api, DataStore data)
 {
     _Api = api;
     _Data = data;
 }
Ejemplo n.º 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();
 }
Ejemplo n.º 40
0
 public AlertInviteViewModel(IApiService apiService, ICacheService cacheService, IMessageboxService messageboxService, IProgressDialogService progressDialogService, IPlatformService platformService)
     : base(apiService, cacheService, messageboxService, progressDialogService, platformService)
 {
 }
Ejemplo n.º 41
0
        public async Task <IActionResult> New(int id)
        {
            ViewBag.Categories = await IApiService.GetCategories();

            return(View());
        }
Ejemplo n.º 42
0
 public CriancasViewModel()
 {
     Criancas   = new ObservableCollection <Criancas>();
     apiService = new ApiService(http);
 }
Ejemplo n.º 43
0
 public NewsService (IApiService apiService)
 {
     _apiService = apiService;
 }
Ejemplo n.º 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,
            });
        }
Ejemplo n.º 45
0
        public async Task <IActionResult> Index()
        {
            ViewBag.products = await IApiService.GetProducts();

            return(View());
        }
Ejemplo n.º 46
0
 public StateService(IApiService api)
 {
     this.api = api;
     User = new UserModel();
 }
Ejemplo n.º 47
0
		public RefitApiService(IApiService apiService)
		{
			_apiService = apiService;
		}
Ejemplo n.º 48
0
 public TodoController(IApiService <TodoItem> apiService) : base(apiService)
 {
 }
 public ContactDataService(IApiService apiService)
 {
     _apiService = apiService;
 }
Ejemplo n.º 50
0
 public Vendor1ServiceWrapper(IApiService apiService, IVendorUrlProvider urlProvider, IVendorCredentialsProvider credentialProvider)
     : base(apiService, urlProvider, credentialProvider, new Mocks.LoggerMock <Vendor1Service>())
 {
 }
Ejemplo n.º 51
0
 public TransactionService(IApiService apiService, IToDoListRepository todoRepository)
 {
     _apiService = apiService;
     _todoRepository = todoRepository;
 }
Ejemplo n.º 52
0
 public ClustersController(IDataService dataService, IApiService apiService) : base(dataService, apiService)
 {
 }
Ejemplo n.º 53
0
 public FerroviarioMasterDetailPageViewModel(INavigationService navigationService, IApiService apiService) : base(navigationService)
 {
     _instance          = this;
     _apiService        = apiService;
     _navigationService = navigationService;
     LoadUser();
     LoadMenus();
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 58
0
 public SetLocationCommand(ITelegramBotClient bot, IStateRepository states, MessageConstants constants, IApiService api)
 {
     _bot       = bot;
     _states    = states;
     _constants = constants;
     _api       = api;
 }
Ejemplo n.º 59
0
 public TaskService(IApiService srv)
 {
     ToggleSrv = srv;
 }
Ejemplo n.º 60
0
 public FileService(IApiService ApiService, ISearchService SearchService)
     : base(ApiService, SearchService, "/api/1.0/files")
 {
 }