// Token: 0x060005DA RID: 1498 RVA: 0x0002C6E0 File Offset: 0x0002A8E0
 private void ProcessFolderType(DefaultFolderType defaultFolderType, DumpsterExpirationEnforcer.AgeLimitAndAction ageLimitAndAction)
 {
     using (Folder folder = Folder.Bind(base.MailboxDataForTags.MailboxSession, defaultFolderType))
     {
         this.ProcessFolderContents(folder, defaultFolderType, ItemQueryType.None, ageLimitAndAction);
         this.ProcessFolderContents(folder, defaultFolderType, ItemQueryType.Associated, ageLimitAndAction);
     }
 }
 // Token: 0x060005DD RID: 1501 RVA: 0x0002C8B4 File Offset: 0x0002AAB4
 private DumpsterExpirationEnforcer.AgeLimitAndAction GetAgeLimitAndAction()
 {
     DumpsterExpirationEnforcer.AgeLimitAndAction result = new DumpsterExpirationEnforcer.AgeLimitAndAction
     {
         RetentionAction = RetentionActionType.PermanentlyDelete,
         AgeLimit        = this.deletionInfo.AgeLimit
     };
     if (this.moveInfo.IsEnabled && this.moveInfo.AgeLimit < result.AgeLimit)
     {
         result.RetentionAction = RetentionActionType.MoveToArchive;
         result.AgeLimit        = this.moveInfo.AgeLimit;
     }
     return(result);
 }
        // Token: 0x060005E0 RID: 1504 RVA: 0x0002CDB8 File Offset: 0x0002AFB8
        private bool EnlistItem(PropertyArrayProxy itemProperties, DefaultFolderType folderTypeToCollect, DumpsterExpirationEnforcer.AgeLimitAndAction ageLimitAndAction)
        {
            VersionedId versionedId = itemProperties[ItemSchema.Id] as VersionedId;

            if (versionedId == null)
            {
                DumpsterExpirationEnforcer.Tracer.TraceError <DumpsterExpirationEnforcer>((long)this.GetHashCode(), "{0}: We could not get id of this item. Skipping it.", this);
                return(true);
            }
            DumpsterExpirationEnforcer.AgeLimitAndAction ageLimitAndAction2 = ageLimitAndAction;
            if (!this.IsTimeToDie(itemProperties, ageLimitAndAction2.AgeLimit))
            {
                DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer, VersionedId, EnhancedTimeSpan>((long)this.GetHashCode(), "{0}: Item {1} newer than minAgeLimitForFolder {2}.", this, versionedId, ageLimitAndAction2.AgeLimit);
                return(false);
            }
            if (ageLimitAndAction2.RetentionAction == RetentionActionType.PermanentlyDelete)
            {
                bool disableCalendarLogging = false;
                if (CalendarLoggingHelper.IsCalendarItem(versionedId.ObjectId))
                {
                    disableCalendarLogging = this.IsTimeToDie(itemProperties, ageLimitAndAction2.AgeLimit);
                }
                if (base.MailboxDataForTags.AbsoluteLitigationHoldEnabled)
                {
                    ItemData itemData = new ItemData(versionedId, (StoreObjectId)itemProperties[StoreObjectSchema.ParentItemId], ItemData.EnforcerType.DumpsterExpirationEnforcer, (int)itemProperties[ItemSchema.Size]);
                    base.TagExpirationExecutor.AddToDoomedMoveToPurgesList(itemData, disableCalendarLogging);
                    this.itemsMovedToPurges++;
                }
                else if (base.MailboxDataForTags.QueryBasedHoldEnabled)
                {
                    ItemData itemData2 = new ItemData(versionedId, (StoreObjectId)itemProperties[StoreObjectSchema.ParentItemId], ItemData.EnforcerType.DumpsterExpirationEnforcer, (int)itemProperties[ItemSchema.Size]);
                    base.TagExpirationExecutor.AddToDoomedMoveToDiscoveryHoldsList(itemData2, disableCalendarLogging);
                }
                else
                {
                    ItemData itemData3 = new ItemData(versionedId, ItemData.EnforcerType.DumpsterExpirationEnforcer, (int)itemProperties[ItemSchema.Size]);
                    base.TagExpirationExecutor.AddToDoomedHardDeleteList(itemData3, disableCalendarLogging);
                }
                this.itemsExpired++;
            }
            else
            {
                base.TagExpirationExecutor.AddToDoomedMoveToArchiveDumpsterList(new ItemData(versionedId, ItemData.EnforcerType.DumpsterExpirationEnforcer, (int)itemProperties[ItemSchema.Size]), folderTypeToCollect);
                this.itemsMoved++;
            }
            return(true);
        }
 // Token: 0x060005D9 RID: 1497 RVA: 0x0002C5A4 File Offset: 0x0002A7A4
 protected override void CollectItemsToExpire()
 {
     this.ResolveDeletionInfo();
     this.ResolveMoveInfo();
     DumpsterExpirationEnforcer.AgeLimitAndAction ageLimitAndAction = new DumpsterExpirationEnforcer.AgeLimitAndAction
     {
         AgeLimit        = this.deletionInfo.AgeLimit,
         RetentionAction = RetentionActionType.PermanentlyDelete
     };
     if (!base.MailboxDataForTags.AbsoluteLitigationHoldEnabled)
     {
         ageLimitAndAction = this.GetAgeLimitAndAction();
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsRoot, ageLimitAndAction);
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsDeletions, ageLimitAndAction);
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsVersions, ageLimitAndAction);
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsPurges, ageLimitAndAction);
         return;
     }
     if (this.moveInfo.IsEnabled)
     {
         if (!this.IsMoveDeletionsToPurgesFlightingEnabled() || this.moveInfo.AgeLimit.Days < this.deletionInfo.AgeLimit.Days)
         {
             ageLimitAndAction = new DumpsterExpirationEnforcer.AgeLimitAndAction
             {
                 AgeLimit        = this.moveInfo.AgeLimit,
                 RetentionAction = RetentionActionType.MoveToArchive
             };
         }
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsDeletions, ageLimitAndAction);
         ageLimitAndAction = new DumpsterExpirationEnforcer.AgeLimitAndAction
         {
             AgeLimit        = this.moveInfo.AgeLimit,
             RetentionAction = RetentionActionType.MoveToArchive
         };
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsRoot, ageLimitAndAction);
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsVersions, ageLimitAndAction);
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsPurges, ageLimitAndAction);
         return;
     }
     if (this.IsMoveDeletionsToPurgesFlightingEnabled())
     {
         this.ProcessFolderType(DefaultFolderType.RecoverableItemsDeletions, ageLimitAndAction);
     }
 }
        // Token: 0x060005DB RID: 1499 RVA: 0x0002C730 File Offset: 0x0002A930
        private void ProcessFolderContents(Folder folder, DefaultFolderType folderTypeToCollect, ItemQueryType itemQueryType, DumpsterExpirationEnforcer.AgeLimitAndAction ageLimitAndAction)
        {
            int num = base.FolderItemTypeCount(folder, itemQueryType);

            if (num <= 0)
            {
                DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer, string, ItemQueryType>((long)this.GetHashCode(), "{0}:{1} Folder is Empty of type {2}", this, folder.Id.ObjectId.ToHexEntryId(), itemQueryType);
                return;
            }
            using (QueryResult queryResult = folder.ItemQuery(itemQueryType, null, new SortBy[]
            {
                new SortBy(StoreObjectSchema.LastModifiedTime, SortOrder.Ascending)
            }, DumpsterExpirationEnforcer.PropertyColumns.PropertyDefinitions))
            {
                queryResult.SeekToOffset(SeekReference.OriginBeginning, 0);
                bool flag = false;
                while (!flag)
                {
                    object[][] rows = queryResult.GetRows(100);
                    if (rows.Length <= 0)
                    {
                        break;
                    }
                    foreach (object[] rawProperties in rows)
                    {
                        PropertyArrayProxy propertyArrayProxy = new PropertyArrayProxy(DumpsterExpirationEnforcer.PropertyColumns, rawProperties);
                        if (!ElcMailboxHelper.Exists(propertyArrayProxy[StoreObjectSchema.LastModifiedTime]))
                        {
                            DumpsterExpirationEnforcer.Tracer.TraceDebug <DumpsterExpirationEnforcer>((long)this.GetHashCode(), "{0}: Last Modified date is missing. Skipping items from here on.", this);
                            flag = true;
                            break;
                        }
                        if (!this.EnlistItem(propertyArrayProxy, folderTypeToCollect, ageLimitAndAction))
                        {
                            flag = true;
                            break;
                        }
                    }
                    base.SysCleanupSubAssistant.ThrottleStoreCallAndCheckForShutdown(base.MailboxDataForTags.MailboxSession.MailboxOwner);
                }
            }
        }