static void ProcessWikipediaFile(string filename) { using (FileStream file = new FileStream(filename, FileMode.OpenOrCreate)) { using (BufferedStream stream = new BufferedStream(file)) { var pageProcessor = new PageXmlToJsonProcessor(); pageProcessor.PageProcessed += Program.pageProcessor_PageProcessed; var processor = new WikipediaXmlProcessor(stream, pageProcessor); processor.ProcessPages(); } } }