Whitelog.Core.File.FileStreamProvider.ShouldArchive C# (CSharp) Method

ShouldArchive() public method

public ShouldArchive ( long currSize, int bytesToAdd, System.DateTime now ) : bool
currSize long
bytesToAdd int
now System.DateTime
return bool
        public bool ShouldArchive(long currSize, int bytesToAdd, DateTime now)
        {
            if (m_configuration.ArchiveAboveSize.HasValue)
            {
                if ((currSize + bytesToAdd) > m_configuration.ArchiveAboveSize.Value)
                {
                    return true;
                }
            }

            if (m_configuration.ArchiveEvery.HasValue)
            {
                if (!m_nextArchive.HasValue)
                {
                    m_nextArchive = GetNextArchiveTime(m_configuration, now);
                }

                if (now > m_nextArchive.Value)
                {
                    return true;
                }
            }

            return false;
        }