/// <summary> /// Получение синглтона обработчика для работы с файлом в памяти. /// </summary> /// <returns>Обработчик.</returns> public static MemoryFileHandler GetInstance() { if (singletonInstance == null) { singletonInstance = new MemoryFileHandler(); } return(singletonInstance); }
public ReadHandler(MemoryFileHandler fileHandler = null) { this.fileHandler = fileHandler ?? MemoryFileHandler.GetInstance(); checking = false; worker = new BackgroundWorker(); worker.WorkerReportsProgress = true; worker.WorkerSupportsCancellation = true; worker.DoWork += Worker_DoWork; worker.ProgressChanged += Worker_ProgressChanged; }
public WriteHandler(string userName, MemoryFileHandler fileHandler = null) { this.fileHandler = fileHandler ?? MemoryFileHandler.GetInstance(); name = userName; }
public static MemoryFileHandler CreateInstance(string path = null, bool fromMemory = false) { singletonInstance = new MemoryFileHandler(path, fromMemory); return(singletonInstance); }