public DataBaseService(string name, string rootPath, long fileSize, SupportedSources source, IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; var regex = new Regex(".*"); //valid if (regex.IsMatch(rootPath)) { DataBase = new DataBase { Name = name, Settings = new Settings { RootPath = rootPath, FileSize = fileSize, DefaultSource = source } }; _fileWorker = fileWorkerFactory.GetFileWorker(DataBase); _fileWorker.UpdateDataBaseFile(); } else { throw new ArgumentException($"Incorrect path: {rootPath}"); } }
public UsersManagerController(IAppUserManager userManager, RoleManager <AppRole> roleManager, IFileWorker fileWorker, ApplicationDbContext context) { _fileWorker = fileWorker; _userManager = userManager; _roleManager = roleManager; _context = context; }
public Inputs() { facade = new ConsoleFacade(); field = new Field(); fileWorker = new FileWorker(); validation = new Validator(); }
public ArticlesController(IUnitOfWork unitOfWork, IFileWorker fileWorker, IEmailSender emailSender) { _fileWorker = fileWorker; _unitOfWork = unitOfWork; _articleRep = _unitOfWork.GetRepository <Article>(); _emailSender = emailSender; }
public FileWatcher() { _culturer = new Culturer(); _logger = Logger.getLogger(); _configurator = new Configurator(); _fileWorker = new FileWorker(this); _folderForListening = _configurator.GetWatherFolders().ToList(); }
public Consumer(IConsumerCollection collection, IFileWorker worker, IResultsWriter writer) { _collection = collection; _worker = worker; _writer = writer; _ctSource = new CancellationTokenSource(); }
private static IEnumerable <IActionPlugin> GetActionPluginsFromFile( IFileWorker <IEnumerable <IActionPlugin> > typeFileWorker) { if (typeFileWorker == null) { throw new ArgumentNullException(nameof(typeFileWorker)); } return(typeFileWorker.Read()); }
private void Open() { IFileWorker worker = DependencyService.Get <IFileWorker>(); if (worker.ExistAsync(basename).Result) { SessionBase = worker.OpenBase(basename).Result; } }
public SortingAlgorithmsController (IOptions <FileWorker> fileWorkerOptions, IEnumerable <IAlgorithmsService> algorithmsService, IStringWorker stringWorkerService, IFileWorker fileWorkerSerivce) { _fileWorkerOptions = fileWorkerOptions; _algorithmsService = algorithmsService; _stringWorkerService = stringWorkerService; _fileWorkerService = fileWorkerSerivce; }
public UserCertificateFileController( ApplicationDbContext context, IMapper mapper, IFilePathGenerator filePathGenerator, IFileWorker fileWorker) { _context = context; _mapper = mapper; _filePathGenerator = filePathGenerator; _fileWorker = fileWorker; }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, IFileWorker fileWorker) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseFileWorker(fileWorker); app.Run(async(context) => { await context.Response.WriteAsync("Hello, world!"); }); }
public DocumentTemplateController( ApplicationDbContext context, IMapper mapper, IFilePathGenerator filePathGenerator, IFileWorker fileWorker) { _context = context; _mapper = mapper; _filePathGenerator = filePathGenerator; _fileWorker = fileWorker; }
public GameLoop() { display = new Display(); facade = new ConsoleFacade(); field = new Field(); fieldAlterations = new FieldAlterations(); file = new FileWorker(); simulation = new Simulation(); inputs = new Inputs(); texts = new Texts(); }
public CSProjProcessor(List <string> _csProjFileNames, IFileWorker _workWithFile) //tested { csProjFileNames = _csProjFileNames; MyWorkWithFile = _workWithFile; RootDocuments = new List <DXProjDocument>(); foreach (var fl in csProjFileNames) { var doc = MyWorkWithFile.LoadXDocument(fl); var dxDoc = new DXProjDocument(doc, fl); RootDocuments.Add(dxDoc); } }
public void InitLocalData() { string file; string localPath; string localCdlFile; string localSigFile; Interval interval; lock (provider) { file = ProviderHelper.GetDataFilePath(provider); localPath = ProviderHelper.GetLocalPath(provider); localCdlFile = ProviderHelper.GetLocalCdlFilePath(provider); localSigFile = ProviderHelper.GetLocalSigFilePath(provider); interval = provider.CurrentTInterval; } Console.WriteLine(" InitLocalData " + file + " local " + localPath); List <BarData> cdlList = new List <BarData>(); List <Signal> sigList = new List <Signal>(); // if (File.Exists(file)) { IFileWorker fw = FileUtil.GetFileWorker(); // if (fw.UnZipFiles(file, localPath, null, false)) { Console.WriteLine(localCdlFile); if (File.Exists(localCdlFile) && fw.LoadCdlFile(localCdlFile, 0, int.MaxValue, out cdlList, true, true)) { if (cdlList.Count > 0) { provider.LocalLastCdlTime = cdlList[cdlList.Count - 1].DateTime; provider.HasLocalLastCdlTime = true; } } if (cdlList.Count > 0 && File.Exists(localSigFile) && fw.LoadSigFile(localSigFile, 0, int.MaxValue, out sigList, true, true)) { sigList.ForEach(SupplementSignals); if (sigList.Count > 0) { provider.LocalLastSigTime = sigList[sigList.Count - 1].ActTime; provider.HasLocalLastSigTime = true; } } } fw = null; } dataUnits.Add(interval, cdlList); signalUnits.Add(interval, sigList); }
public async void SaveBase() { await Task.Run(() => { if (String.IsNullOrEmpty(basename)) { return(Task.CompletedTask); } // перезаписываем файл IFileWorker service = DependencyService.Get <IFileWorker>(); service.SaveBase(basename, SessionBase); return(Task.CompletedTask); }); }
private static void SetActionPluginsInFile(IFileWorker <IEnumerable <IActionPlugin> > typeFileWorker, IEnumerable <IActionPlugin> actionPlugins) { if (typeFileWorker == null) { throw new ArgumentNullException(nameof(typeFileWorker)); } if (actionPlugins == null) { throw new ArgumentNullException(nameof(actionPlugins)); } typeFileWorker.Write(actionPlugins); }
public AdminController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, RoleManager <IdentityRole> roleManager, ApplicationDbContext db, IFileWorker fileWorker ) { _userManager = userManager; _signInManager = signInManager; _roleManager = roleManager; _db = db; _fileWorker = fileWorker; }
public BookRepository(IFileWorker obb) { obb1 = obb; string path = HttpContext.Current.Server.MapPath("~/App_Data/Output2.json"); try { bookList = new List <Books>(obb1.ReadFromJsonFile <List <Books> >(path)); } catch { bookList = new List <Books>(); } finally { } }
public ManageController( UserManager <ApplicationUser> userManager, SignInManager <ApplicationUser> signInManager, IEmailSender emailSender, ILogger <ManageController> logger, UrlEncoder urlEncoder, ApplicationDbContext dbContext, IFileWorker fileWorker ) { _userManager = userManager; _signInManager = signInManager; _emailSender = emailSender; _logger = logger; _urlEncoder = urlEncoder; _db = dbContext; _fileWorker = fileWorker; }
/// <summary> /// Initializes a new instance of the <see cref="QueueProcessor"/> class. /// </summary> /// <param name="appConfig"> /// Application configuration /// </param> /// <param name="processingService"> /// Processing Service /// </param> /// <param name="ffmpegGetCrop"> /// ffmpeg crop interface /// </param> /// <param name="ffmsIndex"> /// ffmsindex interface /// </param> /// <param name="eac3To"> /// eac3to interface /// </param> /// <param name="ffmpegDemuxer"> /// ffmpeg demux interface /// </param> /// <param name="mplayerDemuxer"> /// mplayer demux interface /// </param> /// <param name="mkvExtractSubtitle"> /// mkvextract subtitle demux interface /// </param> /// <param name="demuxerTsMuxeR"> /// tsMuxeR demux interface /// </param> /// <param name="bdSup2Sub"> /// BDSup2Sub interface /// </param> /// <param name="ffmpegAc3"> /// ffmpeg AC-3 encoder Interface /// </param> /// <param name="ffmpegDvd"> /// ffmpeg DVD encoder Interface /// </param> /// <param name="lame"> /// lame encoder Interface /// </param> /// <param name="neroAac"> /// NeroAacEnc Interface /// </param> /// <param name="oggEnc"> /// OggEnc Interface /// </param> /// <param name="x264"> /// x264 encoder Interface /// </param> /// <param name="ffmpegX264"> /// ffmpeg x264 encoder Interface /// </param> /// <param name="fileWorker"> /// FileWorker Interface /// </param> /// <param name="dvdAuthor"> /// DVDAuthor Interface /// </param> /// <param name="mkvMerge"> /// mkvMerge Interface /// </param> /// <param name="mp4Box"> /// mp4box Interface /// </param> /// <param name="mplex"> /// Mplex Interface /// </param> /// <param name="spuMux"> /// SpuMux Interface /// </param> /// <param name="tsMuxeR"> /// tsMuxeR Interface /// </param> public QueueProcessor(IAppConfigService appConfig, IProcessingService processingService, //decoder IDecoderFfmpegGetCrop ffmpegGetCrop, IDecoderFfmsIndex ffmsIndex, //demuxer IDemuxerEac3To eac3To, IDemuxerFfmpeg ffmpegDemuxer, IDemuxerMplayer mplayerDemuxer, IDemuxerMkvExtractSubtitle mkvExtractSubtitle, IDemuxerTsMuxeR demuxerTsMuxeR, //encoder IEncoderBdSup2Sub bdSup2Sub, IEncoderFfmpegAc3 ffmpegAc3, IEncoderFfmpegDvd ffmpegDvd, IEncoderLame lame, IEncoderNeroAac neroAac, IEncoderOggEnc oggEnc, IEncoderX264 x264, IEncoderFfmpegX264 ffmpegX264, //muxer IFileWorker fileWorker, IMuxerDvdAuthor dvdAuthor, IMuxerMkvMerge mkvMerge, IMuxerMp4Box mp4Box, IMuxerMplex mplex, IMuxerSpuMux spuMux, IMuxerTsMuxeR tsMuxeR) { _appConfig = appConfig; _processingService = processingService; _ffmpegGetCrop = ffmpegGetCrop; _ffmsIndex = ffmsIndex; _eac3To = eac3To; _ffmpegDemuxer = ffmpegDemuxer; _mplayerDemuxer = mplayerDemuxer; _mkvExtractSubtitle = mkvExtractSubtitle; _demuxerTsMuxeR = demuxerTsMuxeR; _bdSup2Sub = bdSup2Sub; _ffmpegAc3 = ffmpegAc3; _ffmpegDvd = ffmpegDvd; _lame = lame; _neroAac = neroAac; _oggEnc = oggEnc; _x264 = x264; _ffmpegX264 = ffmpegX264; _fileWorker = fileWorker; _dvdAuthor = dvdAuthor; _mkvMerge = mkvMerge; _mp4Box = mp4Box; _mplex = mplex; _spuMux = spuMux; _tsMuxeR = tsMuxeR; }
public DataBaseService(string path, IFileWorkerFactory fileWorkerFactory, ITableServiceFactory tableServiceFactory, IDbWriterFactory dbWriterFactory) { _tableServiceFactory = tableServiceFactory; _dbWriterFactory = dbWriterFactory; SupportedSources source = ResolvePath(path); _fileWorker = fileWorkerFactory.GetFileWorker(new DataBase { Settings = new Settings { DefaultSource = source } }); DataBase = _fileWorker.GetDataBaseFromFile(path); _fileWorker.DataBase = DataBase; }
public FileWorkerTests() { var mockFileService = new Mock <IFileService>(); var mockFileServiceWithoutFile = new Mock <IFileService>(); var mockFibonacci = new Mock <ISequence>(); fakeFileContent = "Hello world"; var fibonacciSequence = new[] { 0, 1, 1, 2, 3, 5, 8, 13 }; var fakeMemoryStream = new MemoryStream(Encoding.ASCII.GetBytes(fakeFileContent)); mockFileService.Setup(f => f.Open(It.IsAny <string>())) .Returns(() => new StreamReader(fakeMemoryStream)); mockFileServiceWithoutFile.Setup(f => f.Open(It.IsAny <string>())) .Throws <FileNotFoundException>(); mockFibonacci.Setup(s => s[It.IsAny <int>()]).Returns(fibonacciSequence[It.IsAny <int>()]); fileWorker = new FileWorker(mockFileService.Object, mockFibonacci.Object); fileWorkerWithoutFile = new FileWorker(mockFileServiceWithoutFile.Object, mockFibonacci.Object); }
public ArchivePage() { InitializeComponent(); OptionsList.ItemsSource = new List <Option> { new Option { Name = "Open trend", Command = new Command(() => Navigation.PushModalAsync(new OpenTrendPage(_deviceData))) }, new Option { Name = "Open trend graphic", Command = new Command(() => Navigation.PushModalAsync(new NavigationPage(new OpenTrendGraphicPage(_deviceData)))) } }; OptionsList.ItemSelected += OnOptionSelected; _fileWorker = DependencyService.Get <IFileWorker>(); _jsonKeeper = new JsonDataKeeper <DeviceDataViewModel>(); }
private List <QuestCase> LoadBase(string xml) { IFileWorker worker = DependencyService.Get <IFileWorker>(); // List<QuestCase> myBase = new List<QuestCase>(); List <QuestCase> myBase; if (!worker.ExistAsync(basename).Result) { myBase = Parse(xml); } else { try { myBase = worker.OpenBase(basename).Result; } catch (Exception) { worker.DeleteAsync(basename); myBase = Parse(xml); } } return(myBase); }
public ReverseFibonacciLinesApp(IFileWorker fileWorker, IUserInterface ui) { this.fileWorker = fileWorker; this.ui = ui; }
public static IApplicationBuilder UseFileWorker(this IApplicationBuilder builder, IFileWorker fileWorker) { return(builder.UseMiddleware <FileWorkerMiddleware>(fileWorker)); }
public UniversalImageConverter(ImageConvertersProvider imageConvertersProvider, IFileWorker fileWorker) { imageConverters = imageConvertersProvider.ImageConverters; this.fileWorker = fileWorker; }
public FileWorkerMiddleware(RequestDelegate next, IFileWorker fileWorker) { _next = next; _fileWorker = fileWorker; }
/// <summary> /// Создает экземпляр класса TempFileStore. /// </summary> /// <param name="silentWork">Признак работы без диалога.</param> public TempFileStore(bool silentWork = true) : base() { FileWorker = silentWork ? (IFileWorker)new SilentFileWorker() : (IFileWorker)new InteractiveFileWorker(); files = new List<string>(); State = FileStoreState.Changed; }
public UsersManagerController(IAppUserManager userManager, IAppRoleManager roleManager, IFileWorker fileWorker) { _fileWorker = fileWorker; _userManager = userManager; _roleManager = roleManager; }
private void saveButton_Click(object sender, EventArgs e) { try { Directory.SetCurrentDirectory(utils.Properties.currentDirectory); } catch (Exception ex) { } if (exportFile.ShowDialog() == DialogResult.OK) { worker = FileFactory.createWorker(Utils.Formats.VTK, form); propertyWorker = FileFactory.createWorker(Utils.Formats.PROPERTY, form); utils.Properties.currentPathToFile = exportFile.FileName; performingCalculations = true; saveButton.Enabled = false; cancelButton.Enabled = false; stopwatch.Restart(); writeToFile(new int[] { sizeX, sizeY, sizeZ, offsetX, offsetY, offsetZ, stepX, stepY, stepZ, method }); } }