예제 #1
0
        private static void Main()
        {
            ServiceProvider sp = Container.Build();

            IFilesService      filesService      = sp.GetService <IFilesService>();
            IUserAccessService userAccessService = sp.GetService <IUserAccessService>();
            IUserConsoleInputViewModelToNewFileDtoAdapter adapterViewModelToNewFileDto = sp.GetService <IUserConsoleInputViewModelToNewFileDtoAdapter>();

            try
            {
                Console.WriteLine(" ######## Welcome to File Reader ######## ");
                Console.WriteLine(" ######################################## ");
                Console.WriteLine(Environment.NewLine);

                UserConsoleInputViewModel viewModel = new UserConsoleInputViewModel();

                ReadInputOption <UserOperationType>(viewModel.Operation, "operation", UserAccess.AvailableUserOperations());
                ReadInputOption <UserAccessOperationType>(viewModel.AccessOperation, "access operation", UserAccess.AvailableUserAccessOperations());

                ReadUserInputs(viewModel);

                NewFileDto dto = adapterViewModelToNewFileDto.Adapt(viewModel);

                string fileContent = filesService.ReadNewFile(dto);

                Console.WriteLine(fileContent);
                Console.ReadKey();
            }
            finally
            {
                sp.Dispose();
            }
        }
 public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService)
 {
     _fileSystem      = fileSystem;
     _registryService = registryService;
     _filesService    = filesService;
     _config          = Config.get_configuration_settings();
 }
 public OrdersService(IDeletableEntityRepository <OrderDocument> dbOrderDocument, IDeletableEntityRepository <Order> dbOrder, IFilesService filesService, IHtmlSanitizer sanitizer)
 {
     this.dbOrderDocument = dbOrderDocument;
     this.dbOrder         = dbOrder;
     this.filesService    = filesService;
     this.sanitizer       = sanitizer;
 }
 public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService, ChocolateyConfiguration config)
 {
     _fileSystem      = fileSystem;
     _registryService = registryService;
     _filesService    = filesService;
     _config          = config;
 }
예제 #5
0
 public MoviesService(
     IFilesService filesService,
     IMoviesRepository moviesRepository)
 {
     _filesService     = filesService;
     _moviesRepository = moviesRepository;
 }
예제 #6
0
 public DiProxy(
     IPlacesService placesService
     , SessionOperator sessionOperator
     , IObjectTypesService objectTypesService
     , IObjectsService objectsService
     , ILocalizationService localeService
     , IMapper mapper
     , ILocalizer localizer
     , IAdsService adsService
     , IFilesService filesService
     , ConfigValuesCollection configValues
     , IUserInfoService userInfoService)
 {
     _elements.Add(typeof(IPlacesService), placesService);
     _elements.Add(typeof(SessionOperator), sessionOperator);
     _elements.Add(typeof(IObjectTypesService), objectTypesService);
     _elements.Add(typeof(IObjectsService), objectsService);
     _elements.Add(typeof(ILocalizationService), localeService);
     _elements.Add(typeof(IMapper), mapper);
     _elements.Add(typeof(ILocalizer), localizer);
     _elements.Add(typeof(IAdsService), adsService);
     _elements.Add(typeof(IFilesService), filesService);
     _elements.Add(typeof(ConfigValuesCollection), configValues);
     _elements.Add(typeof(IUserInfoService), userInfoService);
 }
 public ProjectsGalleryService(IRepository <GalleryProject> dbImageToProject, IRepository <FileOnFileSystem> dbFileOnFilesystem, IFilesService filesService, IProjectsService projectsService)
 {
     this.dbImageToProject   = dbImageToProject;
     this.dbFileOnFilesystem = dbFileOnFilesystem;
     this.filesService       = filesService;
     this.projectsService    = projectsService;
 }
예제 #8
0
        public FilesServiceTests()
        {
            TestsData testsData = TestsData.Create(nameof(FilesServiceTests));

            filesService     = testsData.AppServiceProvider.FilesService;
            fillTestDbHelper = testsData.FillTestDbHelper;
        }
예제 #9
0
 /// <summary>
 ///   Initializes a new instance of the <see cref="NugetService" /> class.
 /// </summary>
 /// <param name="fileSystem">The file system.</param>
 /// <param name="nugetLogger">The nuget logger</param>
 /// <param name="packageInfoService">Package information service</param>
 /// <param name="filesService">The files service</param>
 public NugetService(IFileSystem fileSystem, ILogger nugetLogger, IChocolateyPackageInformationService packageInfoService, IFilesService filesService)
 {
     _fileSystem = fileSystem;
     _nugetLogger = nugetLogger;
     _packageInfoService = packageInfoService;
     _filesService = filesService;
 }
예제 #10
0
 public DeleteFilesRequestHandler(Request request, ClientConnection clientConnection, INodeNoticeService nodeNoticeService, IFilesService filesService)
 {
     this.request           = (DeleteFilesRequest)request;
     this.clientConnection  = clientConnection;
     this.nodeNoticeService = nodeNoticeService;
     this.filesService      = filesService;
 }
예제 #11
0
 public HomeController(
     ILogger <HomeController> logger,
     IFilesService filesService)
 {
     _logger       = logger;
     _filesService = filesService;
 }
예제 #12
0
 public CategoriesService(NorthwindContext context, IFilesService filesService, IOptions <ApplicationSettings> settingsOptions)
 {
     _context             = context;
     _filesService        = filesService;
     _applicationSettings = settingsOptions.Value;
     _nameOfDirectory     = _applicationSettings.NameOfDirectory;
 }
예제 #13
0
 public FileApiController(IFilesService service,
                          IAuthenticationService <int> authService,
                          ILogger <FileApiController> logger) : base(logger)
 {
     _service     = service;
     _authService = authService;
 }
예제 #14
0
 public UsersService(IUnitOfWork unit, IMapper mapper, IPasswordHasher <User> hasher, Anonymiser <User> anonymiser, IFilesService files)
     : base(unit, mapper)
 {
     Hasher     = hasher;
     Anonymiser = anonymiser;
     Files      = files;
 }
        public async Task InvokeAsync(HttpContext context, IFilesService filesService)
        {
            if (context.Request.Path.Value.Contains("Categories/GetImage") || context.Request.Path.Value.Contains("Categories/image") || context.Request.Path.Value.Contains("Categories/GetFile"))
            {
                var currentTime = DateTime.Now;
                if ((currentTime - _previousTime).Minutes > _maximumPeriodBetweenRequest)
                {
                    if (Directory.Exists(FolderName))
                    {
                        Directory.Delete(FolderName, true);
                    }

                    _previousTime = currentTime;
                    await _next(context);
                }

                var id = int.Parse(context.Request.Path.Value.Split('/').Last());
                var ms = filesService.Read(id);
                if (ms != null)
                {
                    await context.Response.Body.WriteAsync(ms.GetBuffer(), 0, ms.GetBuffer().Length);
                }

                await _next(context);
            }
            else
            {
                await _next(context);
            }
        }
예제 #16
0
 public FilesController(IFilesService filesService, ILogService logService, IMapper mapper, IWebHostEnvironment env)
 {
     _filesService = filesService;
     _logger       = logService;
     _mapper       = mapper;
     _env          = env;
 }
 public UsersController(IUsersService usersService,
                        IUserRoleRequestsRepository userRoleAcceptationsRepository, IFilesService filesService,
                        UserManager <ApplicationUser> userManager)
 {
     _usersService = usersService;
     _fileService  = filesService;
 }
예제 #18
0
 public CommentController(ICommentsService comments, IWebHostEnvironment host, ILogger <CommentController> logger, IFilesService files)
 {
     _commentsService = comments;
     _host            = host;
     _logger          = logger;
     _filesService    = files;
 }
예제 #19
0
 public FilesController(IFilesService fileService, ISlideUpdateManagerService slideUpdateManagerService, IHostingEnvironment hostingEnvironment, ITagManagerService tagManagerService)
 {
     _fileServices = fileService;
     _slideUpdateManagerService = slideUpdateManagerService;
     _hostingEnvironment        = hostingEnvironment;
     _tagManagerService         = tagManagerService;
 }
예제 #20
0
 public BooksController(IUserService users, IBookService books, IFilesService files, IDonationsService donations)
 {
     this.users     = users;
     this.books     = books;
     this.files     = files;
     this.donations = donations;
 }
예제 #21
0
 public OrdersController(IOrdersService ordersService, IServicesService servicesService, IFilesService filesService, UserManager <ApplicationUser> userManager)
 {
     this.ordersService   = ordersService;
     this.servicesService = servicesService;
     this.filesService    = filesService;
     this.userManager     = userManager;
 }
예제 #22
0
 public FolderService(GenericRepo <Katalog> folderRepo, IFilesService filesService,
                      GenericRepo <Plik> fileRepo)
 {
     _folderRepo  = folderRepo;
     _fileService = filesService;
     _fileRepo    = fileRepo;
 }
예제 #23
0
 public AssignmentsController(IAssignmentsService assignmentsService, IStudentsService studentsService, UserManager <ApplicationUser> userManager, IFilesService filesService)
 {
     this.assignmentsService = assignmentsService;
     this.studentsService    = studentsService;
     this.userManager        = userManager;
     this.filesService       = filesService;
 }
예제 #24
0
 public ArtistManager(IArtistRepository artistRepository, IMapper mapper, IFilesService filesService, IConfiguration configuration)
 {
     _artistRepository = artistRepository;
     _mapper           = mapper;
     _filesService     = filesService;
     _configuration    = configuration;
 }
예제 #25
0
 public InformationService(IRepository <ImageToReview> dbImage, IDeletableEntityRepository <Review> dbReview, IFilesService filesService, IHtmlSanitizer sanitizer)
 {
     this.dbImage      = dbImage;
     this.dbReview     = dbReview;
     this.filesService = filesService;
     this.sanitizer    = sanitizer;
 }
예제 #26
0
 public ProductService(MyDBContext context, IFilesService filesService, IMapper mapper)
 {
     _context      = context;
     _filesService = filesService;
     _mapper       = mapper;
     allProduct    = GetProducts().Result;
 }
예제 #27
0
 /// <summary>
 /// Creates a new <see cref="IdeViewModel"/> instance
 /// </summary>
 /// <param name="messenger">The <see cref="IMessenger"/> instance to use</param>
 /// <param name="analyticsService">The <see cref="IAnalyticsService"/> instance to use</param>
 /// <param name="filesService">The <see cref="IFilesService"/> instance to use</param>
 /// <param name="filesManagerService">The <see cref="IFilesManagerService"/> instance to use</param>
 /// <param name="filesHistoryService">The <see cref="IFilesHistoryService"/> instance to use</param>
 public IdeViewModel(IMessenger messenger, IAnalyticsService analyticsService, IFilesService filesService, IFilesManagerService filesManagerService, IFilesHistoryService filesHistoryService)
     : base(messenger)
 {
     AnalyticsService    = analyticsService;
     FilesService        = filesService;
     FilesManagerService = filesManagerService;
     FilesHistoryService = filesHistoryService;
 }
예제 #28
0
 public ChatHub(IContactsService contactsService, IAuthenticationService <int> auth, IChatService chatService, IFilesService filesService, IHubContext <ChatHub> hubContext)
 {
     _contactsService = contactsService;
     _chatService     = chatService;
     _filesService    = filesService;
     _auth            = auth;
     _hubContext      = hubContext;
 }
예제 #29
0
 public ImageService(GifterDbContext dbContext,
                     IOptions <StoreOptions> options,
                     IFilesService filesService)
 {
     this.dbContext    = dbContext;
     this.options      = options.Value;
     this.filesService = filesService;
 }
예제 #30
0
 public AlbumManager(IAlbumRepository albumRepository, IMapper mapper, IFilesService filesService, IConfiguration configuration, IHelper helper)
 {
     _albumRepository = albumRepository;
     _mapper          = mapper;
     _filesService    = filesService;
     _configuration   = configuration;
     _helper          = helper;
 }
예제 #31
0
 public MainPageViewModel(INavigationService navigationService)
     : base(navigationService)
 {
     Title = "PDF File";
     DownloadPdfFileCommand = new DelegateCommand(DownloadPdfFile);
     OpenPdfFileCommand     = new DelegateCommand(OpenPdfFile);
     filesService           = DependencyService.Get <IFilesService>();
 }
 public DefaultMediaManagerApiOperations(IMediaTreeService mediaTree, IImagesService images, IImageService image,
     IFilesService files, IFileService file)
 {
     MediaTree = mediaTree;
     Images = images;
     Image = image;
     Files = files;
     File = file;
 }
 public DefaultMediaManagerApiOperations(IMediaTreeService mediaTree, IImagesService images, IImageService image,
     IFilesService files, IFileService file, IFoldersService folders, IFolderService folder)
 {
     MediaTree = mediaTree;
     Folders = folders;
     Folder = folder;
     Images = images;
     Image = image;
     Files = files;
     File = file;
 }
예제 #34
0
 public ReviewsController(IReviewsService reviews, ICategoriesService categories, IFilesService files)
 {
     this.reviews = reviews;
     this.categories = categories;
     this.files = files;
 }
예제 #35
0
 public ImportOrder(IFilesService filesService, IOrderService orderService)
 {
     _filesService = filesService;
     _orderService = orderService;
 }
예제 #36
0
 public HomeController(IOrderService orderService, IFilesService filesService)
 {
     _orderService = orderService;
     _filesService = filesService;
 }
 public void TestFixtureSetUp()
 {
     _filesService = new RealFilesService();
     _filesFinder = new FilesFinder(_filesService);
 }
예제 #38
0
 public TutorialsController(ITutorialsService tutorials, IFilesService files)
 {
     this.tutorials = tutorials;
     this.files = files;
 }
 public ChocolateyPackageInformationService(IFileSystem fileSystem, IRegistryService registryService, IFilesService filesService)
 {
     _fileSystem = fileSystem;
     _registryService = registryService;
     _filesService = filesService;
 }
예제 #40
0
 public FileController(IFilesService files)
 {
     this.files = files;
 }
 public FilesApiController(IFilesService service)
 {
     this._filesService = service;
 }
 public FilesController(IFilesService filesService, INotesService notesService, ITaskListsService taskListsService)
 {
     _filesService = filesService;
     _notesService = notesService;
     _taskListsService = taskListsService;
 }