public void Process(IntPtr fileHandle)
        {
            var logFileParser = new LogFileParserSimpleFactory().Create(fileHandle);

            var logFile = logFileParser.Parse();

            var statistics = new LogFileStatisticsEventArgs
            {
                WarningCount = logFile.Warnings.Count(),
                ErrorCount   = logFile.Errors.Count()
            };

            OnStatisticsCollected?.Invoke(this, statistics);
        }
Ejemplo n.º 2
0
        public void Process(IntPtr fileHandle)
        {
            var safeFileHandle = new SafeFileHandle(fileHandle, false);
            var fileStream     = new FileStream(safeFileHandle, FileAccess.Read);
            var streamReader   = new StreamReader(fileStream);
            var logFileParser  = new LogFileParser(streamReader);

            var logFile = logFileParser.Parse();

            var statistics = new LogFileStatisticsEventArgs
            {
                WarningCount = logFile.Warnings.Count(),
                ErrorCount   = logFile.Errors.Count()
            };

            OnStatisticsCollected?.Invoke(this, statistics);
        }