Пример #1
0
        private void ParserThread()
        {
            string     absoluteFilePath;
            BaseParser parser = Activator.CreateInstance <T>();

            while (true)
            {
                Thread.Sleep(0);

                absoluteFilePath = FileUpdater.GetNextFile <T>();

                Interlocked.Increment(ref m_threadsWorking);
                try
                {
                    parser.ParseFile(absoluteFilePath);
                }
                catch (Exception e)
                {
                    //TODO: LOG ERROR
                }
                finally
                {
                    Interlocked.Decrement(ref m_threadsWorking);
                }
            }
        }
Пример #2
0
 private void CollectFilesInitial()
 {
     foreach (string fileFilter in m_fileFilters)
     {
         foreach (string absolutePath in Directory.GetFiles(AbsoluteRootDirectory, fileFilter, SearchOption.AllDirectories))
         {
             FileUpdater.AddFileToParse <T>(absolutePath);
         }
     }
 }
Пример #3
0
 private void OnFileCreated(object sender, FileSystemEventArgs e)
 {
     FileUpdater.AddFileToParse <T>(e.FullPath);
 }