<PackageReference Include="Relativity.Transfer.Client" Version="7.2.26" />

TransferStatisticsPublisherGuard

using System; namespace Relativity.Transfer { internal class TransferStatisticsPublisherGuard : ITransferStatisticsPublisherGuard { private ITransferStatistics lastPublishedStatistics; public TransferStatisticsPublisherGuard(ITransferStatistics statistics) { if (statistics == null) throw new ArgumentNullException("statistics"); lastPublishedStatistics = statistics; } public bool CanPublish(ITransferStatistics statisticsToBePublished) { bool flag = lastPublishedStatistics.TotalRequestBytes <= statisticsToBePublished.TotalRequestBytes && lastPublishedStatistics.TotalRequestFiles <= statisticsToBePublished.TotalRequestFiles && lastPublishedStatistics.TotalTransferredBytes <= statisticsToBePublished.TotalTransferredBytes && lastPublishedStatistics.TotalTransferredFiles <= statisticsToBePublished.TotalTransferredFiles; if (flag) lastPublishedStatistics = statisticsToBePublished; return flag; } } }