NLog.Targets.FileTarget.FlushCurrentFileWrites C# (CSharp) Method

FlushCurrentFileWrites() private method

private FlushCurrentFileWrites ( string currentFileName, LogEventInfo firstLogEvent, MemoryStream ms, List pendingContinuations ) : void
currentFileName string
firstLogEvent LogEventInfo
ms System.IO.MemoryStream
pendingContinuations List
return void
        private void FlushCurrentFileWrites(string currentFileName, LogEventInfo firstLogEvent, MemoryStream ms,
            List<AsyncContinuation> pendingContinuations)
        {
            Exception lastException = null;

            try
            {
                if (currentFileName != null)
                    ProcessLogEvent(firstLogEvent, currentFileName, ms.ToArray());
            }
            catch (Exception exception)
            {
                if (exception.MustBeRethrown())
                {
                    throw;
                }

                lastException = exception;
            }

            foreach (AsyncContinuation cont in pendingContinuations)
            {
                cont(lastException);
            }

            pendingContinuations.Clear();
        }