示例#1
0
 /// <summary>
 /// Получение синглтона обработчика для работы с файлом в памяти.
 /// </summary>
 /// <returns>Обработчик.</returns>
 public static MemoryFileHandler GetInstance()
 {
     if (singletonInstance == null)
     {
         singletonInstance = new MemoryFileHandler();
     }
     return(singletonInstance);
 }
示例#2
0
 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;
 }
示例#3
0
 public WriteHandler(string userName, MemoryFileHandler fileHandler = null)
 {
     this.fileHandler = fileHandler ?? MemoryFileHandler.GetInstance();
     name             = userName;
 }
示例#4
0
 public static MemoryFileHandler CreateInstance(string path = null, bool fromMemory = false)
 {
     singletonInstance = new MemoryFileHandler(path, fromMemory);
     return(singletonInstance);
 }