Example #1
0
        public GetDocumentStreamQueryHandler(ILogger <GetDocumentStreamQueryHandler> logger,
                                             IFileClient fileClient,
                                             ISIOProjectionDbContextFactory projectionDbContextFactory,
                                             IContentTypeProvider contentTypeProvider)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (fileClient is null)
            {
                throw new ArgumentNullException(nameof(fileClient));
            }
            if (projectionDbContextFactory is null)
            {
                throw new ArgumentNullException(nameof(projectionDbContextFactory));
            }
            if (contentTypeProvider is null)
            {
                throw new ArgumentNullException(nameof(contentTypeProvider));
            }

            _logger     = logger;
            _fileClient = fileClient;
            _projectionDbContextFactory = projectionDbContextFactory;
            _contentTypeProvider        = contentTypeProvider;
        }
Example #2
0
 public FindCustomerViewModel(IEndpointClient endpointClient, DbManager dbManager, IPreferenceManager preferenceManager, IFileClient fileClient)
 {
     this.endpointClient    = endpointClient;
     this.dbManager         = dbManager;
     this.preferenceManager = preferenceManager;
     this.fileClient        = fileClient;
 }
Example #3
0
        public PdfService(IOrderViewClient orderViewClient, IFileClient fileClient, IKenticoResourceService resources, IKenticoDocumentProvider documents, IKenticoLogger logger)
        {
            if (orderViewClient == null)
            {
                throw new ArgumentNullException(nameof(orderViewClient));
            }
            if (fileClient == null)
            {
                throw new ArgumentNullException(nameof(fileClient));
            }
            if (resources == null)
            {
                throw new ArgumentNullException(nameof(resources));
            }
            if (documents == null)
            {
                throw new ArgumentNullException(nameof(documents));
            }
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            this.orderViewClient = orderViewClient;
            this.fileClient      = fileClient;
            this.resources       = resources;
            this.documents       = documents;
            this.logger          = logger;
        }
Example #4
0
 public HomeController(ApplicationDbContext context,
                       ITenantProvider tenantProvider,
                       IFileClient fileClient)
 {
     _context        = context;
     _tenantProvider = tenantProvider;
 }
 public FileManager(DbManager dbManager, IPreferenceManager preferenceManager, IEndpointClient endpointClient, IFileClient fileClient)
 {
     this.dbManager         = dbManager;
     this.preferenceManager = preferenceManager;
     this.endpointClient    = endpointClient;
     this.fileClient        = fileClient;
 }
Example #6
0
        public EmhiCalculator(EmhiCalculatorSettings settings, IFileClient fileClient)
        {
            _settings   = settings;
            _fileClient = fileClient;

            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
        }
Example #7
0
 public ConsumeBinary(IAgnosticConsumer <byte[]> consumer, IFileClient fileClient, IOptions <ApplicationSettings> settings, ILogger <ConsumeBinary> logger)
 {
     this.consumer   = consumer;
     this.fileClient = fileClient;
     this.settings   = settings;
     this.logger     = logger;
 }
Example #8
0
        public UploadDocumentCommandHandler(ILogger <UploadDocumentCommandHandler> logger,
                                            IAggregateRepository <SIOStoreDbContext> aggregateRepository,
                                            IAggregateFactory aggregateFactory,
                                            IFileClient fileClient)
        {
            if (logger == null)
            {
                throw new ArgumentNullException(nameof(logger));
            }
            if (aggregateRepository == null)
            {
                throw new ArgumentNullException(nameof(aggregateRepository));
            }
            if (aggregateFactory == null)
            {
                throw new ArgumentNullException(nameof(aggregateFactory));
            }
            if (fileClient == null)
            {
                throw new ArgumentNullException(nameof(fileClient));
            }

            _logger = logger;
            _aggregateRepository = aggregateRepository;
            _aggregateFactory    = aggregateFactory;
            _fileClient          = fileClient;
        }
 public ProduceBinary(IAgnosticProducer <byte[]> producer, IFileClient fileClient, IOptions <ApplicationSettings> settings, ILogger <ProduceBinary> logger)
 {
     this.producer   = producer;
     this.fileClient = fileClient;
     this.settings   = settings;
     this.logger     = logger;
 }
 public FileReceiver(IFileClient client, IScheduler scheduler, string path, string fileMask, ILogger logger = null)
 {
     _path              = path;
     _fileMask          = fileMask;
     _client            = client;
     _logger            = logger;
     scheduler.Trigger += _scheduler_Trigger;
 }
        public RecipeIngredientRepository(IFileClient client)
        {
            if (client == null)
            {
                throw new ArgumentNullException();
            }

            this.client = client;
        }
Example #12
0
        public EmhiCalculator(EmhiCalculatorSettings settings,
                              IFileClient fileClient,
                              ILogger <EmhiCalculator> logger)
        {
            _settings   = settings;
            _fileClient = fileClient;
            _logger     = logger;

            Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
        }
Example #13
0
 public HomeController(ApplicationDbContext dataContext,
                       IHostingEnvironment host,
                       IFileClient fileClient,
                       GalleryContext galleryContext)
 {
     _dataContext    = dataContext;
     _galleryContext = galleryContext;
     _host           = host;
     _fileClient     = fileClient;
 }
Example #14
0
 public GetFileWithEffectsCommand(ApplicationDbContext dataContext,
                                  IHostingEnvironment host,
                                  IFileClient fileClient,
                                  ILogger <HomeController> logger,
                                  GalleryContext galleryContext)
 {
     _dataContext    = dataContext;
     _galleryContext = galleryContext;
     _fileClient     = fileClient;
     _logger         = logger;
 }
 public SaveFolderToStoreCommand(ApplicationDbContext dataContext,
                                 GalleryContext galleryContext,
                                 IHostingEnvironment host,
                                 IFileClient fileClient,
                                 ILogger <SaveFolderToStoreCommand> logger)
 {
     _dataContext    = dataContext;
     _logger         = logger;
     _galleryContext = galleryContext;
     _host           = host;
     _fileClient     = fileClient;
 }
        public LocalTranslationWorker(IEventPublisher eventPublisher,
                                      IFileClient fileClient)
        {
            if (eventPublisher == null)
            {
                throw new ArgumentNullException(nameof(eventPublisher));
            }
            if (fileClient == null)
            {
                throw new ArgumentNullException(nameof(fileClient));
            }

            _eventPublisher = eventPublisher;
            _fileClient     = fileClient;
        }
Example #17
0
 public DependantResourceHandler(
     IFileClient fileClient,
     IScenarioClient scenarioClient,
     IResultConfigClient resultConfigClient,
     ISimPlanClient simPlanClient,
     ISimRunClient simRunClient,
     IResultDataClient resultDataClient
     )
 {
     _fileClient         = fileClient;
     _scenarioClient     = scenarioClient;
     _resultConfigClient = resultConfigClient;
     _simPlanClient      = simPlanClient;
     _simRunClient       = simRunClient;
     _resultDataClient   = resultDataClient;
 }
Example #18
0
 public FileService(IFileClient fileClient, IKenticoResourceService resources, IKenticoLogger logger)
 {
     if (fileClient == null)
     {
         throw new ArgumentNullException(nameof(fileClient));
     }
     if (resources == null)
     {
         throw new ArgumentNullException(nameof(resources));
     }
     if (logger == null)
     {
         throw new ArgumentNullException(nameof(logger));
     }
     _fileClient = fileClient;
     _resources  = resources;
     _logger     = logger;
 }
        public LoginForm()
        {
            InitializeComponent();

            this.client = MainForm.Current.FileClient;
            try { File.WriteAllText(WinAPIs.GetHandleFile(), this.Handle.ToString(), Encoding.UTF8); }
            catch { }

            this.lb_Msg.Text = "";

            this.SetEnabled(true);

            if (ConfigUtils.IsRememberPassword)
            {
                this.txt_Account.Text      = ConfigUtils.Account;
                this.txt_Pwd.Text          = ConfigUtils.Password;
                this.checkBox_User.Checked = true;
            }
        }
Example #20
0
        public AWSSpeechSynthesizer(IFileClient fileClient, IOptions <AWSCredentialOptions> awsCredentialOptions, IOptions <AWSTranslationOptions> translationOptions)
        {
            if (fileClient == null)
            {
                throw new ArgumentNullException(nameof(fileClient));
            }
            if (awsCredentialOptions == null)
            {
                throw new ArgumentNullException(nameof(awsCredentialOptions));
            }
            if (translationOptions == null)
            {
                throw new ArgumentNullException(nameof(translationOptions));
            }

            _fileClient         = fileClient;
            _pollyClient        = new AmazonPollyClient(new BasicAWSCredentials(awsCredentialOptions.Value.AccessKey, awsCredentialOptions.Value.SecretKey), RegionEndpoint.EUWest2);
            _translationOptions = translationOptions.Value;
        }
        public GoogleTranslationWorker(IEventPublisher eventPublisher,
                                       IFileClient fileClient,
                                       ISpeechSynthesizer <GoogleSpeechRequest> speechSynthesizer)
        {
            if (eventPublisher == null)
            {
                throw new ArgumentNullException(nameof(eventPublisher));
            }
            if (fileClient == null)
            {
                throw new ArgumentNullException(nameof(fileClient));
            }
            if (speechSynthesizer == null)
            {
                throw new ArgumentNullException(nameof(speechSynthesizer));
            }

            _eventPublisher    = eventPublisher;
            _fileClient        = fileClient;
            _speechSynthesizer = speechSynthesizer;
        }
Example #22
0
 public void InitFileClient(IFileClient fileClient) => _fileClient = fileClient;
Example #23
0
 public ExcelReportGenerator(IFileClient fileClient)
 {
     this._fileClient = fileClient;
 }
Example #24
0
        private static async Task LoadDirectoriesAsync(IFileClient client, string path, string dstPath)
        {
            var existsFiles       = Directory.EnumerateFiles(dstPath).Select(Path.GetFileName).ToList();
            var existsDirectories = Directory.EnumerateDirectories(dstPath).Select(Path.GetFileName).ToList();

            var items = await client.GetItemsAsync(path);

            foreach (var item in items)
            {
                try
                {
                    if (item.Name.IndexOf("\\") != -1)
                    {
                        await _writer.WriteLineAsync($"XX: {item.FullName}");

                        Console.WriteLine($"XX: {item.FullName}");
                        continue;
                    }

                    if (_ignoreRegices.Any(t => t.IsMatch(item.FullName)))
                    {
                        continue;
                    }

                    switch (item.Type)
                    {
                    case ItemType.File:
                    {
                        existsFiles.Remove(item.Name);
                        var file = new FileInfo(Path.Combine(dstPath, item.Name));
                        if (!file.Exists || file.LastWriteTime != item.Modified || file.Length != item.Size)
                        {
                            await _writer.WriteLineAsync($"!: {item.FullName}");

                            Console.WriteLine($"!: {item.FullName}");
                            await client.DownloadFileAsync(item.FullName, file.FullName);

                            file.Refresh();
                            if (file.Length != item.Size)
                            {
                                throw new Exception();
                            }
                            file.LastWriteTime = item.Modified;
                        }
                        else
                        {
                            await _writer.WriteLineAsync($"x: {item.FullName}");

                            Console.WriteLine($"x: {item.FullName}");
                        }
                    }
                    break;

                    case ItemType.Directory:
                    {
                        existsDirectories.Remove(item.Name);
                        await _writer.WriteLineAsync($"D: {item.FullName}");

                        Console.WriteLine($"D: {item.FullName}");
                        var ndpath = Path.Combine(dstPath, item.Name);
                        Directory.CreateDirectory(ndpath);

                        await LoadDirectoriesAsync(client, item.FullName, ndpath);

                        Directory.SetLastWriteTime(ndpath, item.Modified);
                    }
                    break;

                    case ItemType.Others:
                        await _writer.WriteLineAsync($"O: {item.FullName}");

                        Console.WriteLine($"O: {item.FullName}");
                        break;

                    default:
                        await _writer.WriteLineAsync($"?: {item.FullName}");

                        Console.WriteLine($"?: {item.FullName}");
                        break;
                    }
                }
                catch (Exception exp)
                {
                    await _writer.WriteLineAsync("ERROR");

                    await _writer.WriteLineAsync(exp.ToString());
                }
            }

            foreach (var item in existsFiles.Where(t => !_undeletableNames.Contains(t)))
            {
                File.Delete(Path.Combine(dstPath, item));
            }

            foreach (var item in existsDirectories.Where(t => !_undeletableNames.Contains(t)))
            {
                Directory.Delete(Path.Combine(dstPath, item), true);
            }
        }
Example #25
0
 public GalleryContext(ApplicationDbContext context, IFileClient fileClient)
 {
     _dataContext = context;
     _fileClient  = fileClient;
 }
 public void Initialize()
 {
     this.client           = new FileClientMock();
     this.recipeRepository = new RecipeRepository(this.client);
 }
 public HotelRepository(IFileClient fileClient)
 {
     _fileClient = fileClient;
 }
Example #28
0
 public FileLogger(IFileProviderOptions options, IEnumerable <ILogSerializer> serializers, IFileClient client)
 {
     this.options     = options;
     this.serializers = serializers;
     this.client      = client;
 }
Example #29
0
 public FileAsyncThread(IFileClient <TU, TD> fileClient)
 {
     FileClient = fileClient;
     task       = null;
 }
 public OptionLogService(IFileClient client)
     : base(client)
 {
 }