public static FilesReader GetInstance(string _folderStr) { if (instance == null) { lock (syncRoot) { if (instance == null) { instance = new FilesReader(_folderStr); } } } return(instance); }
static void Main(string[] args) { sw = new Stopwatch(); sw.Start(); outputFN = @"C:\Users\rong.fan\Desktop\CommVaultInterviewCode\OutPut\result.csv"; inputFolder = @"C:\Users\rong.fan\Desktop\CommVaultInterviewCode\allcores"; fw = new FileWriter(outputFN); FilesReader filesReader = FilesReaderProvider.GetInstance(inputFolder); filesReader.LineReaded += FilesReader_LineReaded;; filesReader.FilesReadCompleted += FilesReader_FilesReadCompleted; filesReader.BeginReadLine(); }