public static LocalIndexHandler Initialize(CASCConfig config, BackgroundWorkerEx worker) { var handler = new LocalIndexHandler(); var idxFiles = GetIdxFiles(config); if (idxFiles.Count == 0) { throw new FileNotFoundException("idx files missing!"); } worker?.ReportProgress(0, "Loading \"local indexes\"..."); int idxIndex = 0; foreach (var idx in idxFiles) { handler.ParseIndex(idx); worker?.ReportProgress((int)(++idxIndex / (float)idxFiles.Count * 100)); } Logger.WriteLine("LocalIndexHandler: loaded {0} indexes", handler.Count); return(handler); }
public static LocalIndexHandler Initialize(CASCConfig config, BackgroundWorkerEx worker) { var handler = new LocalIndexHandler(); var idxFiles = GetIdxFiles(config); if (idxFiles.Count == 0) throw new FileNotFoundException("idx files missing!"); worker?.ReportProgress(0, "Loading \"local indexes\"..."); int idxIndex = 0; foreach (var idx in idxFiles) { handler.ParseIndex(idx); worker?.ReportProgress((int)(++idxIndex / (float)idxFiles.Count * 100)); } Logger.WriteLine("LocalIndexHandler: loaded {0} indexes", handler.Count); return handler; }