Exemple #1
0
        public int DeleteExpired()
        {
            int num = 0;

            foreach (FileInfo fileInfo in this.Archives())
            {
                if (this.Map(fileInfo).Expires.GetValueOrDefault(DateTimeOffset.MaxValue) > Time.UtcNow)
                {
                    continue;
                }
                FileBasedArchiveService.DeleteArchive(fileInfo);
                num++;
            }
            return(num);
        }
Exemple #2
0
        public int Delete(DateTimeOffset olderThan)
        {
            int num = 0;

            foreach (FileInfo fileInfo in this.Archives())
            {
                if (fileInfo.CreationTimeUtc > olderThan)
                {
                    continue;
                }
                FileBasedArchiveService.DeleteArchive(fileInfo);
                num++;
            }
            return(num);
        }