Ejemplo n.º 1
0
        public MainPresenter(IMainForm mainForm, IJsonService jsonService, IHtmlService htmlService,
                             IHtmlParser htmlParser, ILoggerFactory loggerFactory)
        {
            this._mainForm = mainForm;

            this._jsonService = jsonService;

            this._htmlService = htmlService;

            this._htmlParser = htmlParser;

            this._loggerFactory = loggerFactory;

            this._mainForm.OnFormLoad += new EventHandler(this._mainForm_OnLoad);

            this._mainForm.NewElementEdded += new EventHandler(this._mainForm_NewElementEdded);

            this._mainForm.StartButtonClick += this._mainForm_StartButtonClick;

            this._mainForm.StopButtonClick += this._mainForm_StopButtonClick;

            this._mainForm.GetLastDrawClick += _mainForm_GetLastDrawClick;

            this._mainForm.ButtonTestClick += _mainForm_ButtonTestClick;

            this._mainForm.MainFormFormClosing += _mainForm_MainFormFormClosing;
        }
Ejemplo n.º 2
0
        public LoadingViewModel(Type mainpage, INavigation navigation)
        {
            _mainpage = mainpage;
            string dbSql = DependencyService.Get <ISQLite>().GetLocalFilePath("db.sqlite3");

            _jsonService = new JsonService();

            _versionService        = new VersionService(dbSql);
            _getClientParamService = new GetClientParamService(dbSql);

            IsLoading   = true;
            TextLoading = "Vérification du fichier de configuration...";
            // Get config file
            var jsonObject = Utils.DeserializeFromJson <JsonModel>(_jsonService.GetJson());

            //var jsonObject = Utils.DeserializeFromJson<JsonModel>("{\"Version\": \"1.0.0.0\",\"Companies\": [{\"CompanyName\": \"e-Kenz\",\"Url\": \"http://navapi.saas.e-kenz.com\", \"Domain\": \"SAAS\"},{\"CompanyName\": \"Company1\",\"Url\": \"URL1\", \"Domain\": \"Domain1\"},{\"CompanyName\": \"Company2\",\"Url\": \"URL2\", \"Domain\": \"Domain2\"}]}");
            CreateTables(dbSql);
            PopulateDb(dbSql, jsonObject);
            //Task.Run(async () => await CreateTablesAsync(dbSql));
            //Task.Run(async () => await PopulateDb(dbSql, jsonObject));

            Device.StartTimer(TimeSpan.FromSeconds(2), () =>
            {
                Device.BeginInvokeOnMainThread(async() => await SwitchPage());
                return(false);
            });
        }
Ejemplo n.º 3
0
 public NewsTabViewModel(IMvxNavigationService navigationService, IJsonService json)
     : base(navigationService)
 {
     Title        = "News";
     _jsonService = json;
     News         = new MvxObservableCollection <NewsModel>();
 }
Ejemplo n.º 4
0
 public FileService(IJsonService jsonService = null, IImageService imageService = null)
 {
     this.jsonService    = jsonService ?? new JsonService();
     this.imageService   = imageService ?? new ImageService();
     timer               = null;
     oldMovingThreadInfo = null;
 }
Ejemplo n.º 5
0
        public VkService()
        {
            _rnd = new Random();

            _htmlService = new HtmlService();
            _jsonService = new JsonService();
        }
Ejemplo n.º 6
0
 public DriverRepository(IHttpClientService httpClientService, IJsonService jsonService, IResourcesService resourcesService, INetworkService networkService)
 {
     this.HttpClientService = httpClientService;
     this.JsonService       = jsonService;
     this.ResourcesService  = resourcesService;
     this.NetworkService    = networkService;
 }
Ejemplo n.º 7
0
 public SortedTreeController(ILogger <SortedTreeController> logger, IStorageService storage, IJsonService jsonService, IWebHostEnvironment env)
 {
     _logger      = logger;
     _storage     = storage;
     _jsonService = jsonService;
     _env         = env;
 }
Ejemplo n.º 8
0
        public MainWindowViewModel(IDatabaseService databaseService, IMessenger messenger, IImageService imageService,
                                   IDataService dataService, IJsonService jsonService, IFtpService ftpService, IConfigService configService)
        {
            _databaseService = databaseService;
            _messenger       = messenger;
            _imageService    = imageService;
            _dataService     = dataService;
            _jsonService     = jsonService;
            _ftpService      = ftpService;
            _configService   = configService;

            //register for messages
            _messenger.Register <ChooseFilesConfirmMsg>(this, OnChooseFilesConfirmMsg);
            _messenger.Register <ImportConfirmMsg>(this, OnImportConfirmMsg);
            _messenger.Register <ExportViewClosedMsg>(this, OnExportviewClosedMsg);
            _messenger.Register <ChooseFilesGoogleDriveConfirmMsg>(this, OnChooseFilesGoogleDriveConfirmMsg);
            _messenger.Register <FileProcessFinishedMsg>(this, OnFileProcessFinishedMsg);

            IsGoogleDriveEnabled =
                Convert.ToBoolean(_configService.GetAppSettingsValue(AppSettingConstants.IsGoogleDriveEnabled));

            _mobileKey = _configService.GetAppSettingsValue(AppSettingConstants.MobileKey);

            if (!string.IsNullOrEmpty(_mobileKey))
            {
                HasMobileKey = true;
            }

            if (IsGoogleDriveEnabled)
            {
                _googleDriveService = Container.Resolve <IGoogleDriveService>();
                _googleDriveService.DownloadCompleted += GoogleDriveService_DownloadCompleted;
            }
        }
Ejemplo n.º 9
0
 /// <summary>
 /// Creates a <see cref="HttpNodeJSService"/>.
 /// </summary>
 /// <param name="outOfProcessNodeJSServiceOptionsAccessor"></param>
 /// <param name="httpContentFactory"></param>
 /// <param name="embeddedResourcesService"></param>
 /// <param name="fileWatcherFactory"></param>
 /// <param name="monitorService"></param>
 /// <param name="taskService"></param>
 /// <param name="httpClientService"></param>
 /// <param name="jsonService"></param>
 /// <param name="nodeJSProcessFactory"></param>
 /// <param name="logger"></param>
 public HttpNodeJSService(IOptions <OutOfProcessNodeJSServiceOptions> outOfProcessNodeJSServiceOptionsAccessor,
                          IHttpContentFactory httpContentFactory,
                          IEmbeddedResourcesService embeddedResourcesService,
                          IFileWatcherFactory fileWatcherFactory,
                          IMonitorService monitorService,
                          ITaskService taskService,
                          IHttpClientService httpClientService,
                          IJsonService jsonService,
                          INodeJSProcessFactory nodeJSProcessFactory,
                          ILogger <HttpNodeJSService> logger) :
     base(nodeJSProcessFactory,
          logger,
          outOfProcessNodeJSServiceOptionsAccessor,
          embeddedResourcesService,
          fileWatcherFactory,
          monitorService,
          taskService,
          typeof(HttpNodeJSService).GetTypeInfo().Assembly,
          SERVER_SCRIPT_NAME)
 {
     _httpClientService  = httpClientService;
     _jsonService        = jsonService;
     _logger             = logger;
     _httpContentFactory = httpContentFactory;
 }
        private HttpNodeJSService CreateHttpNodeJSService(IOptions <OutOfProcessNodeJSServiceOptions> outOfProcessNodeHostOptionsAccessor = null,
                                                          IHttpContentFactory httpContentFactory             = null,
                                                          IEmbeddedResourcesService embeddedResourcesService = null,
                                                          IFileWatcherFactory fileWatcherFactory             = null,
                                                          IMonitorService monitorService           = null,
                                                          ITaskService taskService                 = null,
                                                          IHttpClientService httpClientService     = null,
                                                          IJsonService jsonService                 = null,
                                                          INodeJSProcessFactory nodeProcessFactory = null,
                                                          ILogger <HttpNodeJSService> logger       = null)
        {
            if (logger == null)
            {
                Mock <ILogger <HttpNodeJSService> > mockLogger = _mockRepository.Create <ILogger <HttpNodeJSService> >();
                logger = mockLogger.Object;
            }

            return(new HttpNodeJSService(outOfProcessNodeHostOptionsAccessor,
                                         httpContentFactory,
                                         embeddedResourcesService,
                                         fileWatcherFactory,
                                         monitorService,
                                         taskService,
                                         httpClientService,
                                         jsonService,
                                         nodeProcessFactory,
                                         logger));
        }
Ejemplo n.º 11
0
 public StorageService(IJsonService jsonService, IWebHostEnvironment env)
 {
     _jsonService = jsonService;
     if (!File.Exists(TreeFileName) && env.IsDevelopment())
     {
         SaveTree(new Tree {
         });
         // SaveTree (new Tree {
         //     Root = new Node ("A",
         //         new Node ("B",
         //             new Node ("E"),
         //             new Node ("F"),
         //             new Node ("G")),
         //         new Node ("C",
         //             new Node ("H")),
         //         new Node ("D",
         //             new Node ("I",
         //                 new Node ("K"),
         //                 new Node ("L"),
         //                 new Node ("M")),
         //             new Node ("J"))
         //     )
         // });
     }
 }
Ejemplo n.º 12
0
        public MassiveTasksService(IMassiveRepository MassiveTaskRepository, IJsonService JsonService, IJiraRepository JiraRepository)

        {
            _massiveTaskRepository = MassiveTaskRepository;
            _jsonService           = JsonService;
            _jiraRepository        = JiraRepository;
        }
Ejemplo n.º 13
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IWebHostEnvironment env,
                              IJsonService jsonService)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            // Enable middleware to serve generated Swagger as a JSON endpoint.
            app.ConfigureSwaggerUI();

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthentication();

            app.UseAuthorization();

            app.UseApiResponseMiddleware();

            app.UseDefaultFiles();

            app.UseStaticFiles();

            app.UseCors(CORS_NAME);

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
Ejemplo n.º 14
0
        public PeoplePageViewModel(IJsonService jsonService)
        {
            _jsonService = jsonService;

            OwnedByMale   = new ObservableCollection <Pet>();
            OwnedByFemale = new ObservableCollection <Pet>();
        }
Ejemplo n.º 15
0
        public void returns_an_enumerable_of_users()
        {
            IJsonService jsonService = Substitute.For <IJsonService>();

            jsonService.GetUsers().Returns(new List <User>());

            jsonService.GetUsers().ShouldBeAssignableTo <IEnumerable <User> >();
        }
Ejemplo n.º 16
0
        public DBService(IJsonService jsonService)
        {
            _jsonService = jsonService;

            ConnectionString = "mongodb://*****:*****@cluster0-shard-00-00-mzo9x.mongodb.net:27017,cluster0-shard-00-01-mzo9x.mongodb.net:27017,cluster0-shard-00-02-mzo9x.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin";

            Client = new MongoClient(ConnectionString);
        }
Ejemplo n.º 17
0
        public PeopleRepoTests()
        {
            _peopleStore = Substitute.For <IPeopleStore>();
            _fileService = Substitute.For <IFileService>();
            _jsonService = Substitute.For <IJsonService>();

            _peopleRepo = new PeopleRepo(_peopleStore, _fileService, _jsonService, Options.Create(new DataFileSettings()));
        }
Ejemplo n.º 18
0
 public HttpService(IJsonService jsonService)
 {
     _jsonService = jsonService;
     _httpclient  = new HttpClient
     {
         BaseAddress = new Uri("https://techtestapi.azurewebsites.net/api/")
     };
 }
 public WorkLoadService(IJsonService jsonService, IDemandService demandService, IOperatorService operatorService, IJobService jobService, IPenaltyService penaltyService, IParameterService parameterService)
 {
     JsonService      = jsonService;
     DemandService    = demandService;
     OperatorService  = operatorService;
     JobService       = jobService;
     ParameterService = parameterService;
 }
Ejemplo n.º 20
0
 public FolioUserService
 (
     IFolioRepository folioRepository,
     IJsonService jsonService
 )
 {
     _folioRepository = folioRepository;
     _jsonService     = jsonService;
 }
 public HostConfigurationProvider(
     IAppSetting appSetting,
     ILog log,
     IJsonService jsonService)
 {
     this.appSetting  = appSetting;
     this.log         = log;
     this.jsonService = jsonService;
 }
 public WriteJsonReportsFacade(
     IJsonService jsonService,
     IMySqlDatabaseContext mySqlContext,
     AbstractComputersFactoryDbContext sqlServercontext)
 {
     this.jsonService      = jsonService;
     this.mySqlContext     = mySqlContext;
     this.sqlServercontext = sqlServercontext;
 }
        /// <summary>
        /// 得到Json序列化
        /// </summary>
        /// <returns></returns>
        public static IJsonService GetJsonProvider()
        {
            if (_jsonProvider == null)
            {
                _jsonProvider = GetServiceProvider().GetService <IJsonService>();
            }

            return(_jsonProvider);
        }
Ejemplo n.º 24
0
 public AuthedApiService(
     IHttpClientFactory http,
     IJsonService json,
     ICacheService cache,
     ILogger <ApiService> logger,
     T settings) : base(http, json, cache, logger)
 {
     _settings = settings;
 }
Ejemplo n.º 25
0
 public ImportService(IProductService productService, ICourierService courierService, ISupplierService supplierService, IFileReader fileReader, IValidator validator, IJsonService jsonService)
 {
     this.productService  = productService ?? throw new ArgumentNullException(nameof(productService));
     this.courierService  = courierService ?? throw new ArgumentNullException(nameof(courierService));
     this.supplierService = supplierService ?? throw new ArgumentNullException(nameof(supplierService));
     this.fileReader      = fileReader ?? throw new ArgumentNullException(nameof(fileReader));
     this.validator       = validator ?? throw new ArgumentNullException(nameof(validator));
     this.jsonService     = jsonService ?? throw new ArgumentNullException(nameof(validator));
 }
Ejemplo n.º 26
0
 public RedisRepo(
     IRedisConnection con,
     IRedisConfig config,
     IJsonService json)
 {
     _con    = con;
     _config = config;
     _json   = json;
 }
Ejemplo n.º 27
0
 /// <summary>
 /// The constructor for this implementation of state management
 /// </summary>
 public Store(IMapper mapper, ILoggingService logging, IJsonService jsonService)
 {
     this.stateHistory.Add(new StateEntry <TState> {
         ActionName = null, NewState = null, UpdatedAt = DateTimeOffset.UtcNow
     });
     this.mapper      = mapper;
     this.logging     = logging;
     this.jsonService = jsonService;
 }
        /// <summary>
        /// Creates an <see cref="InvocationContent"/> instance.
        /// </summary>
        /// <param name="jsonService">The service for serializing data to JSON.</param>
        /// <param name="invocationRequest">The invocation request to transmit over Http.</param>
        public InvocationContent(IJsonService jsonService, InvocationRequest invocationRequest)
        {
            _invocationRequest = invocationRequest;
            _jsonService       = jsonService;

            if (invocationRequest.ModuleSourceType == ModuleSourceType.Stream)
            {
                Headers.ContentType = _multipartContentType;
            }
        }
Ejemplo n.º 29
0
 public ExposedHttpNodeJSService(IOptions <OutOfProcessNodeJSServiceOptions> outOfProcessNodeHostOptionsAccessor,
                                 IHttpContentFactory httpContentFactory,
                                 IEmbeddedResourcesService embeddedResourcesService,
                                 IHttpClientService httpClientService,
                                 IJsonService jsonService,
                                 INodeJSProcessFactory nodeProcessFactory,
                                 ILoggerFactory loggerFactory) :
     base(outOfProcessNodeHostOptionsAccessor, httpContentFactory, embeddedResourcesService, httpClientService, jsonService, nodeProcessFactory, loggerFactory)
 {
 }
        public ConfigurationWrapper(IJsonService jsonService)
        {
            AppSettings = jsonService.DeserializeFromFile <AppSettings>(AppSettings, "NucleusInvoice.json");


            if (AppSettings.CurrentCompany != null)
            {
                CompanySettings = jsonService.DeserializeFromFile <CompanySettings>(CompanySettings, AppSettings.CurrentCompany.Name + ".json");
            }
        }
Ejemplo n.º 31
0
 public EmployeeService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 32
0
 public CompanyService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 33
0
 public OrderService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 34
0
 public HourService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 35
0
 public ActivityService(IJsonService service)
 {
     _service = service;
 }
 public AccountingReportService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 37
0
 public ProjectService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 38
0
 public VoucherService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 39
0
 public Parser(IExcelReaderService excel, IJsonService json, IRestService rest)
 {
     _excel = excel;
     _json = json;
     _rest = rest;
 }
Ejemplo n.º 40
0
 public SalaryReportService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 41
0
 public SyncService(IJsonService service)
 {
     _service = service;
 }
Ejemplo n.º 42
0
 public InvoiceService(IJsonService service)
 {
     _service = service;
 }