示例#1
0
        // Token: 0x06000498 RID: 1176 RVA: 0x00021494 File Offset: 0x0001F694
        private bool UpdateArchiveTag(object[] itemProperties, out Guid effectiveGuid)
        {
            bool result = false;
            Guid value  = ElcMailboxHelper.GetGuidFromBytes(itemProperties[this.propertyIndexHolder.ArchiveTagIndex], new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;
            Guid value2 = ElcMailboxHelper.GetGuidFromBytes(itemProperties[this.propertyIndexHolder.ExplicitArchiveTagIndex], new Guid?(Guid.Empty), true, (VersionedId)itemProperties[this.propertyIndexHolder.IdIndex]).Value;

            effectiveGuid = Guid.Empty;
            bool flag  = !Guid.Empty.Equals(value);
            bool flag2 = itemProperties[this.propertyIndexHolder.ArchivePeriodIndex] is int;
            bool flag3 = flag && base.ElcUserTagInformation.ContainsTag(value);
            bool flag4 = this.inheritedArchiveGuid != null && !Guid.Empty.Equals(this.inheritedArchiveGuid.Value);

            if (!value2.Equals(Guid.Empty) && base.ElcUserTagInformation.ContainsTag(value2))
            {
                result        = true;
                effectiveGuid = value2;
                base.AddAdriftTagToFai(value2);
                base.PropertiesToBeDeleted.Add(StoreObjectSchema.ExplicitArchiveTag);
                base.PropertiesToBeUpdated.Add(StoreObjectSchema.ArchiveTag, effectiveGuid.ToByteArray());
                itemProperties[this.propertyIndexHolder.ArchivePeriodIndex] = 1;
                ELCPerfmon.TotalItemsWithPersonalTag.Increment();
                this.taggedByPersonalArchiveTag = true;
            }
            else if (flag && flag3 && flag2)
            {
                effectiveGuid = value;
                base.AddAdriftTagToFai(value);
            }
            else if (flag4 && (!flag || !flag2 || (flag && !flag3)))
            {
                if (flag && flag2 && !flag3)
                {
                    base.PropertiesToBeUpdated.Add(StoreObjectSchema.ExplicitArchiveTag, value.ToByteArray());
                    base.AddDeletedTag(value);
                }
                if (!this.inheritedArchiveGuid.Equals(value))
                {
                    result = true;
                    base.PropertiesToBeUpdated.Add(StoreObjectSchema.ArchiveTag, this.inheritedArchiveGuid.Value.ToByteArray());
                    if (base.ElcUserTagInformation.GetTag(this.inheritedArchiveGuid.Value).Tag.Type == ElcFolderType.Personal)
                    {
                        ELCPerfmon.TotalItemsWithPersonalTag.Increment();
                        this.taggedByPersonalArchiveTag = true;
                    }
                    else
                    {
                        ELCPerfmon.TotalItemsWithDefaultTag.Increment();
                        PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Found item with default archive tag", this);
                    }
                }
                effectiveGuid = this.inheritedArchiveGuid.Value;
            }
            else if (flag)
            {
                result = true;
                base.PropertiesToBeDeleted.Add(StoreObjectSchema.ArchiveTag);
                this.taggedByPersonalArchiveTag = true;
            }
            return(result);
        }
示例#2
0
        // Token: 0x0600044C RID: 1100 RVA: 0x0001ECCC File Offset: 0x0001CECC
        private Guid GetParentTag()
        {
            PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer, string>((long)this.GetHashCode(), "{0}: Start searching parent retention tag for folder: {1}", this, base.FolderDisplayName);
            Guid result = Guid.Empty;

            for (int i = this.indexInTree - 1; i >= 0; i--)
            {
                if (((VersionedId)this.entireFolderList[i][0]).ObjectId.Equals((StoreObjectId)this.entireFolderList[this.indexInTree][5]))
                {
                    result = ElcMailboxHelper.GetGuidFromBytes(this.entireFolderList[i][2], new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;
                    PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer, object>((long)this.GetHashCode(), "{0}: Found parent tag from parent folder: {1}", this, this.entireFolderList[i][1]);
                    break;
                }
            }
            if (this.parentFolderIdToPropertyMap != null && result.Equals(Guid.Empty))
            {
                PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: Cannot find parent in the current folder list. Try to find parent in parentFolderIdToPropertyMap", this);
                Synchronizer.FolderPropertySet folderPropertySet;
                if (this.parentFolderIdToPropertyMap.TryGetValue((StoreObjectId)this.entireFolderList[this.indexInTree][5], out folderPropertySet))
                {
                    result = ElcMailboxHelper.GetGuidFromBytes(folderPropertySet.PolicyTagProperty, new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;
                    PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: Found parent in parentFolderIdToPropertyMap", this);
                }
            }
            return(result);
        }
示例#3
0
        // Token: 0x06000446 RID: 1094 RVA: 0x0001E360 File Offset: 0x0001C560
        private void UpdateArchiveSettings()
        {
            PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: Processing archive tag on a folderfolder.", this);
            Guid           value          = ElcMailboxHelper.GetGuidFromBytes(base.FolderProperties[7], new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;
            Guid           value2         = ElcMailboxHelper.GetGuidFromBytes(base.FolderProperties[10], new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;
            ContentSetting contentSetting = null;

            this.effectiveArchiveGuid = null;
            if (value2 != Guid.Empty)
            {
                if (base.ElcUserTagInformation.ContainsTag(value2))
                {
                    contentSetting = base.ElcUserTagInformation.GetRetentionEnabledSettingForTag(value2);
                    base.PropertiesToBeDeleted.Add(StoreObjectSchema.ExplicitArchiveTag);
                    this.effectiveArchiveGuid = new Guid?(value2);
                    base.PropertiesToBeUpdated.Add(StoreObjectSchema.ArchiveTag, this.effectiveArchiveGuid.Value.ToByteArray());
                    base.AddAdriftTagToFai(value2);
                    this.taggedByPersonalArchiveTag = true;
                }
            }
            else if (value != Guid.Empty)
            {
                if (base.ElcUserTagInformation.ContainsTag(value))
                {
                    contentSetting            = base.ElcUserTagInformation.GetRetentionEnabledSettingForTag(value);
                    this.effectiveArchiveGuid = new Guid?(value);
                    base.AddAdriftTagToFai(value);
                }
                else
                {
                    base.PropertiesToBeUpdated.Add(StoreObjectSchema.ExplicitArchiveTag, value.ToByteArray());
                    base.PropertiesToBeDeleted.Add(StoreObjectSchema.ArchiveTag);
                    base.AddDeletedTag(value);
                    this.taggedByPersonalArchiveTag = true;
                }
            }
            this.explicitArchive = FlagsMan.IsExplicitArchiveSet(this.originalRetentionFlags);
            if (contentSetting != null && contentSetting.AgeLimitForRetention != null)
            {
                int num = (int)contentSetting.AgeLimitForRetention.Value.TotalDays;
                if (base.FolderProperties[8] is int)
                {
                    int num2 = (int)base.FolderProperties[8];
                    if (num != num2)
                    {
                        base.PropertiesToBeUpdated.Add(StoreObjectSchema.ArchivePeriod, num);
                        return;
                    }
                }
                else
                {
                    base.PropertiesToBeUpdated.Add(StoreObjectSchema.ArchivePeriod, num);
                }
            }
        }
示例#4
0
        // Token: 0x0600044E RID: 1102 RVA: 0x0001EEE0 File Offset: 0x0001D0E0
        private Guid?GetArchiveGuid()
        {
            PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer, string>((long)this.GetHashCode(), "{0}: Start searching parent archive tag for folder: {1}", this, base.FolderDisplayName);
            if (this.effectiveArchiveGuid != null)
            {
                return(this.effectiveArchiveGuid);
            }
            Guid guid  = Guid.Empty;
            int  i     = this.indexInTree - 1;
            int  index = this.indexInTree;

            while (i >= 0)
            {
                if (((VersionedId)this.entireFolderList[i][0]).ObjectId.Equals((StoreObjectId)this.entireFolderList[index][5]))
                {
                    guid = ElcMailboxHelper.GetGuidFromBytes(this.entireFolderList[i][7], new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;
                    if (!(guid == Guid.Empty) && base.ElcUserTagInformation.ContainsTag(guid))
                    {
                        this.effectiveArchiveGuid = new Guid?(guid);
                        break;
                    }
                    index = i;
                }
                i--;
            }
            if (this.parentFolderIdToPropertyMap != null && (this.effectiveArchiveGuid == null || this.effectiveArchiveGuid.Value.Equals(Guid.Empty) || !base.ElcUserTagInformation.ContainsTag(this.effectiveArchiveGuid.Value)))
            {
                PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: Cannot find parent in the current folder list. Try to find parent in parentFolderIdToPropertyMap", this);
                StoreObjectId key = (StoreObjectId)this.entireFolderList[index][5];
                Synchronizer.FolderPropertySet folderPropertySet;
                while (this.parentFolderIdToPropertyMap.TryGetValue(key, out folderPropertySet))
                {
                    guid = ElcMailboxHelper.GetGuidFromBytes(folderPropertySet.ArchiveTagProperty, new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;
                    if (!(guid == Guid.Empty) && base.ElcUserTagInformation.ContainsTag(guid))
                    {
                        PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: Find parent in parentFolderIdToPropertyMap. And it has intelligable archive GUID. Stop...", this);
                        this.effectiveArchiveGuid = new Guid?(guid);
                        break;
                    }
                    key = folderPropertySet.ParentFolderId;
                    PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: Find parent in parentFolderIdToPropertyMap. But it has no intelligable archive GUID. Continue...", this);
                }
            }
            return(this.effectiveArchiveGuid);
        }
示例#5
0
        // Token: 0x06000493 RID: 1171 RVA: 0x00021068 File Offset: 0x0001F268
        private Guid GetEffectiveParentTag(string messageClass)
        {
            Guid guid = ElcMailboxHelper.GetGuidFromBytes(base.FolderProperties[2], new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;

            if (guid == Guid.Empty)
            {
                if (messageClass.StartsWith(ElcMessageClass.VoiceMail.TrimEnd(new char[]
                {
                    '*'
                }), StringComparison.OrdinalIgnoreCase) && !base.ElcUserTagInformation.DefaultVmAdTag.Equals(Guid.Empty))
                {
                    guid = base.ElcUserTagInformation.DefaultVmAdTag;
                }
                else
                {
                    guid = base.ElcUserTagInformation.DefaultAdTag;
                }
            }
            return(guid);
        }
示例#6
0
 // Token: 0x0600043E RID: 1086 RVA: 0x0001DCBC File Offset: 0x0001BEBC
 internal FolderPropertySynchronizer(MailboxDataForTags mailboxDataForTags, ElcTagSubAssistant elcAssistant, Dictionary <StoreObjectId, Synchronizer.FolderPropertySet> parentFolderIdToPropertyMap, List <object[]> entireFolderList, int indexInTree) : base(mailboxDataForTags, elcAssistant)
 {
     this.entireFolderList            = entireFolderList;
     this.indexInTree                 = indexInTree;
     base.FolderProperties            = entireFolderList[indexInTree];
     this.parentFolderIdToPropertyMap = parentFolderIdToPropertyMap;
     this.originalTagGuid             = ElcMailboxHelper.GetGuidFromBytes(base.FolderProperties[2], new Guid?(Guid.Empty), true, base.FolderDisplayName).Value;
     this.originalRetentionFlags      = RetentionAndArchiveFlags.None;
     if (base.FolderProperties[3] is int)
     {
         this.originalRetentionFlags = (RetentionAndArchiveFlags)base.FolderProperties[3];
         this.explicitRetention      = FlagsMan.IsExplicitSet(this.originalRetentionFlags);
         this.explicitArchive        = FlagsMan.IsExplicitArchiveSet(this.originalRetentionFlags);
     }
     this.originalRetentionPeriod = -1;
     if (base.FolderProperties[4] is int)
     {
         this.originalRetentionPeriod = (int)base.FolderProperties[4];
     }
 }
示例#7
0
        // Token: 0x06000491 RID: 1169 RVA: 0x00020AF8 File Offset: 0x0001ECF8
        private Guid UpdateTagProperties(out bool tagChanged, out Guid effectiveParentTagGuid, string itemClass, object[] itemProperties)
        {
            PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Start to update tag properties", this);
            Guid value           = ElcMailboxHelper.GetGuidFromBytes(itemProperties[this.propertyIndexHolder.PolicyTagIndex], new Guid?(Guid.Empty), true, (VersionedId)itemProperties[this.propertyIndexHolder.IdIndex]).Value;
            Guid value2          = ElcMailboxHelper.GetGuidFromBytes(itemProperties[this.propertyIndexHolder.ExplicitPolicyTagIndex], new Guid?(Guid.Empty), true, (VersionedId)itemProperties[this.propertyIndexHolder.IdIndex]).Value;
            int? retentionPeriod = (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int) ? ((int?)itemProperties[this.propertyIndexHolder.RetentionPeriodIndex]) : null;
            int? retentionFlags  = (itemProperties[this.propertyIndexHolder.RetentionFlagsIndex] is int) ? ((int?)itemProperties[this.propertyIndexHolder.RetentionFlagsIndex]) : null;

            tagChanged = false;
            Guid guid = value;

            effectiveParentTagGuid = this.GetEffectiveParentTag(itemClass);
            bool flag  = TagAssistantHelper.IsTagImplicit(retentionPeriod, retentionFlags);
            bool flag2 = !base.ElcUserTagInformation.ContainsTag(value);

            if (!value2.Equals(Guid.Empty) && base.ElcUserTagInformation.ContainsTag(value2))
            {
                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Found explicit personal tag", this);
                tagChanged = true;
                guid       = value2;
                base.AddAdriftTagToFai(value2);
                this.SetTagProperties(guid, value, true);
                base.PropertiesToBeDeleted.Add(StoreObjectSchema.ExplicitPolicyTag);
                itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] = 1;
                ELCPerfmon.TotalItemsWithPersonalTag.Increment();
                this.taggedByPersonalExpiryTag = true;
            }
            else if (flag || (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int && flag2))
            {
                if (!effectiveParentTagGuid.Equals(value))
                {
                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The original tag doesn't match the parent tag", this);
                    if (!flag)
                    {
                        base.PropertiesToBeUpdated.Add(StoreObjectSchema.ExplicitPolicyTag, value.ToByteArray());
                        base.AddDeletedTag(value);
                    }
                    if (!this.ShouldSkipImplicitItem(itemProperties, effectiveParentTagGuid, value, itemClass))
                    {
                        tagChanged = true;
                        guid       = effectiveParentTagGuid;
                        this.SetTagProperties(effectiveParentTagGuid, value, false);
                        itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] = null;
                        if (effectiveParentTagGuid != Guid.Empty)
                        {
                            if (base.ElcUserTagInformation.AllAdTags.ContainsKey(effectiveParentTagGuid))
                            {
                                if (base.ElcUserTagInformation.GetTag(effectiveParentTagGuid).Tag.Type == ElcFolderType.Personal)
                                {
                                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Inherited explicit personal tag", this);
                                    ELCPerfmon.TotalItemsWithPersonalTag.Increment();
                                    this.taggedByPersonalExpiryTag = true;
                                }
                                else if (base.ElcUserTagInformation.GetTag(effectiveParentTagGuid).Tag.Type == ElcFolderType.All)
                                {
                                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Inherited default tag", this);
                                    ELCPerfmon.TotalItemsWithDefaultTag.Increment();
                                    this.taggedByDefaultExpiryTag = true;
                                }
                                else
                                {
                                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Inherited system tag", this);
                                    ELCPerfmon.TotalItemsWithDefaultTag.Increment();
                                    this.taggedBySystemExpiryTag = true;
                                }
                            }
                            else
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The parent tag is not in AD. Its type is unknown.", this);
                                this.taggedByUncertainExpiryTag = true;
                            }
                        }
                        else if (!flag)
                        {
                            PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The tag is explicit. Removed personal tag", this);
                            this.taggedByPersonalExpiryTag = true;
                        }
                        else if (!flag2)
                        {
                            if (base.ElcUserTagInformation.GetTag(value).Tag.Type == ElcFolderType.Personal)
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Removed personal tag", this);
                                this.taggedByPersonalExpiryTag = true;
                            }
                            else if (base.ElcUserTagInformation.GetTag(value).Tag.Type == ElcFolderType.All)
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Removed default tag", this);
                                this.taggedByDefaultExpiryTag = true;
                            }
                            else
                            {
                                PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: Removed system tag", this);
                                this.taggedBySystemExpiryTag = true;
                            }
                        }
                        else
                        {
                            PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The removed tag is deleted in AD. Its type is unknown.", this);
                            this.taggedByUncertainExpiryTag = true;
                        }
                    }
                    else
                    {
                        PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The item is skipped", this);
                    }
                }
                else
                {
                    PropertySynchronizerBase.Tracer.TraceDebug <ItemPropertySynchronizer>((long)this.GetHashCode(), "{0}: The original tag matches the parent tag", this);
                    if (FlagsMan.IsAutoTagSet(itemProperties[this.propertyIndexHolder.RetentionFlagsIndex]))
                    {
                        base.PropertiesToBeDeleted.Add(StoreObjectSchema.RetentionPeriod);
                        itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] = null;
                    }
                }
            }
            else if (itemProperties[this.propertyIndexHolder.RetentionPeriodIndex] is int)
            {
                base.AddAdriftTagToFai(value);
            }
            return(guid);
        }
示例#8
0
        // Token: 0x06000444 RID: 1092 RVA: 0x0001E04C File Offset: 0x0001C24C
        private Guid UpdatePersonalFolder(out bool tagChanged)
        {
            PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: Processing personal folder.", this);
            tagChanged = false;
            Guid guid  = this.originalTagGuid;
            Guid value = ElcMailboxHelper.GetGuidFromBytes(base.FolderProperties[9], new Guid?(Guid.Empty), false, base.FolderDisplayName).Value;

            if (!value.Equals(Guid.Empty) && base.ElcUserTagInformation.ContainsTag(value))
            {
                tagChanged = true;
                base.PropertiesToBeDeleted.Add(StoreObjectSchema.ExplicitPolicyTag);
                guid = value;
                this.SetTagProperties(guid, true);
                base.AddAdriftTagToFai(value);
                this.taggedByPersonalExpiryTag = true;
            }
            else
            {
                Guid parentTag = this.GetParentTag();
                if ((!FlagsMan.IsExplicitSet(this.originalRetentionFlags) || (FlagsMan.IsExplicitSet(this.originalRetentionFlags) && !base.ElcUserTagInformation.ContainsTag(this.originalTagGuid))) && !parentTag.Equals(this.originalTagGuid))
                {
                    if (FlagsMan.IsExplicitSet(this.originalRetentionFlags))
                    {
                        base.PropertiesToBeUpdated.Add(StoreObjectSchema.ExplicitPolicyTag, this.originalTagGuid.ToByteArray());
                        base.AddDeletedTag(this.originalTagGuid);
                    }
                    this.SetTagProperties(parentTag, false);
                    tagChanged = true;
                    guid       = parentTag;
                    PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: The AD tag and store tag for this personal folder are not the same.", this);
                    if (parentTag.Equals(Guid.Empty))
                    {
                        if (FlagsMan.IsExplicitSet(this.originalRetentionFlags))
                        {
                            this.taggedByPersonalExpiryTag = true;
                        }
                        else if (base.ElcUserTagInformation.ContainsTag(this.originalTagGuid))
                        {
                            if (base.ElcUserTagInformation.GetTag(this.originalTagGuid).Tag.Type == ElcFolderType.Personal)
                            {
                                this.taggedByPersonalExpiryTag = true;
                            }
                            else
                            {
                                this.taggedBySystemExpiryTag = true;
                            }
                        }
                        else
                        {
                            PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: The parent tag is deleted in AD. Its type is unknown.", this);
                            this.taggedByUncertainExpiryTag = true;
                        }
                    }
                    else if (base.ElcUserTagInformation.ContainsTag(parentTag))
                    {
                        if (base.ElcUserTagInformation.GetTag(parentTag).Tag.Type == ElcFolderType.Personal)
                        {
                            this.taggedByPersonalExpiryTag = true;
                        }
                        else
                        {
                            this.taggedBySystemExpiryTag = true;
                        }
                    }
                    else
                    {
                        PropertySynchronizerBase.Tracer.TraceDebug <FolderPropertySynchronizer>((long)this.GetHashCode(), "{0}: The parent tag is not in AD. Its type is unknown.", this);
                        this.taggedByUncertainExpiryTag = true;
                    }
                }
                else if (FlagsMan.IsExplicitSet(this.originalRetentionFlags))
                {
                    base.AddAdriftTagToFai(this.originalTagGuid);
                }
            }
            this.SetDefaultPolicy(guid);
            return(guid);
        }
        // Token: 0x060003D2 RID: 978 RVA: 0x0001B678 File Offset: 0x00019878
        private void EnlistItem(object[] itemProperties, int policyIndex, int dateIndex, PropertyIndexHolder propertyIndexHolder)
        {
            string messageClass;

            if (!this.PreScreenPassed(itemProperties, propertyIndexHolder, out messageClass))
            {
                return;
            }
            if (itemProperties[dateIndex] == null || itemProperties[dateIndex] is PropertyError)
            {
                ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Item has null Retention Date. Skipping it.", this);
                return;
            }
            Guid value = ElcMailboxHelper.GetGuidFromBytes(itemProperties[policyIndex], new Guid?(Guid.Empty), false, (VersionedId)itemProperties[propertyIndexHolder.IdIndex]).Value;

            if (value.Equals(Guid.Empty))
            {
                ExpirationTagEnforcer.Tracer.TraceError <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Item has no retention tag. Skipping it.", this);
                return;
            }
            ContentSetting retentionEnabledSettingForTag = ((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetRetentionEnabledSettingForTag(value, messageClass);

            if (retentionEnabledSettingForTag == null)
            {
                ExpirationTagEnforcer.Tracer.TraceDebug <ExpirationTagEnforcer>((long)this.GetHashCode(), "{0}: Could not find a Content Setting for this item. Skipping it.", this);
                return;
            }
            Dictionary <Guid, AdTagData> allTags    = ((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetAllTags();
            Dictionary <Guid, string>    dictionary = new Dictionary <Guid, string>();

            foreach (KeyValuePair <Guid, AdTagData> keyValuePair in allTags)
            {
                dictionary.Add(keyValuePair.Key, keyValuePair.Value.Tag.Name);
            }
            this.tagExpirationExecutor.AddToReportAndDoomedList(itemProperties, propertyIndexHolder, retentionEnabledSettingForTag, dictionary, ItemData.EnforcerType.ExpirationTagEnforcer, false);
            if (((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetTag(value).Tag.Type == ElcFolderType.Personal)
            {
                if (retentionEnabledSettingForTag.RetentionAction == RetentionActionType.MoveToArchive)
                {
                    this.numberItemsMovedByPersonal++;
                    return;
                }
                this.numberItemsExpiredByPersonal++;
                return;
            }
            else
            {
                if (((ElcUserTagInformation)base.MailboxDataForTags.ElcUserInformation).GetTag(value).Tag.Type != ElcFolderType.All)
                {
                    this.numberItemsExpiredBySystem++;
                    return;
                }
                if (retentionEnabledSettingForTag.RetentionAction == RetentionActionType.MoveToArchive)
                {
                    this.numberItemsMovedByDefault++;
                    return;
                }
                this.numberItemsExpiredByDefault++;
                return;
            }
        }
        // Token: 0x060003E6 RID: 998 RVA: 0x0001BF74 File Offset: 0x0001A174
        private void ProcessFolder(List <object[]> folderList)
        {
            for (int i = 0; i < folderList.Count; i++)
            {
                try
                {
                    if (!this.fullCrawl)
                    {
                        StoreObjectId storeObjectId = folderList[i][5] as StoreObjectId;
                        VersionedId   versionedId   = folderList[i][0] as VersionedId;
                        int           flags         = 0;
                        if (folderList[i][3] is int)
                        {
                            flags = (int)folderList[i][3];
                        }
                        bool flag   = false;
                        Guid value  = ElcMailboxHelper.GetGuidFromBytes(folderList[i][7], new Guid?(Guid.Empty), true, folderList[i][1]).Value;
                        Guid value2 = ElcMailboxHelper.GetGuidFromBytes(folderList[i][2], new Guid?(Guid.Empty), true, folderList[i][1]).Value;
                        DefaultFolderType defaultFolderType = this.mailboxDataForTags.MailboxSession.IsDefaultFolderType(versionedId.ObjectId);
                        bool flag2 = defaultFolderType == DefaultFolderType.Calendar || defaultFolderType == DefaultFolderType.Tasks || defaultFolderType == DefaultFolderType.DeletedItems || defaultFolderType == DefaultFolderType.SentItems || defaultFolderType == DefaultFolderType.JunkEmail || defaultFolderType == DefaultFolderType.Drafts;
                        if (!flag2 && folderList[i][11] is string)
                        {
                            flag2 = (ObjectClass.IsCalendarFolder((string)folderList[i][11]) || ObjectClass.IsTaskFolder((string)folderList[i][11]));
                        }
                        if (flag2)
                        {
                            foreach (AdTagData adTagData in this.mailboxDataForTags.ElcUserTagInformation.GetPolicyTagsList())
                            {
                                if (adTagData.Tag.Type == ElcFolderType.Calendar || adTagData.Tag.Type == ElcFolderType.Tasks || adTagData.Tag.Type == ElcFolderType.DeletedItems || adTagData.Tag.Type == ElcFolderType.SentItems || adTagData.Tag.Type == ElcFolderType.JunkEmail || adTagData.Tag.Type == ElcFolderType.All || adTagData.Tag.Type == ElcFolderType.Drafts)
                                {
                                    flag = true;
                                }
                            }
                            if (value != Guid.Empty || value2 != Guid.Empty)
                            {
                                flag = true;
                            }
                        }
                        if ((flag || FlagsMan.DoesFolderNeedRescan(flags)) && !this.folderMapping.ContainsKey(versionedId.ObjectId))
                        {
                            FolderTagData folderTagData = new FolderTagData();
                            folderTagData.ArchiveGuid   = value;
                            folderTagData.RetentionGuid = value2;
                            this.folderMapping.Add(versionedId.ObjectId, folderTagData);
                        }
                        if (storeObjectId != null && this.folderMapping.ContainsKey(storeObjectId) && !this.folderMapping.ContainsKey(versionedId.ObjectId))
                        {
                            this.folderMapping.Add(versionedId.ObjectId, this.folderMapping[storeObjectId]);
                        }
                        if (versionedId != null && !this.folderMapping.ContainsKey(versionedId.ObjectId))
                        {
                            goto IL_3A5;
                        }
                    }
                    FolderPropertySynchronizer folderPropertySynchronizer = new FolderPropertySynchronizer(this.mailboxDataForTags, this.elcAssistant, this.parentFolderIdToPropertyMap, folderList, i);
                    folderPropertySynchronizer.Update();
                }
                catch (ArgumentOutOfRangeException ex)
                {
                    string text = string.Format("{0} Corrupted Data. Skip current folder {1} at index {2}. FolderList count is {3} and folder properties length is {4}. Exception: {5}", new object[]
                    {
                        this,
                        folderList[i][1],
                        i,
                        folderList.Count,
                        folderList[i].Length,
                        ex
                    });
                    Synchronizer.Tracer.TraceDebug((long)this.GetHashCode(), text);
                    Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_MRMSkippingFolder, null, new object[]
                    {
                        folderList[i][1],
                        text
                    });
                }
                catch (ObjectNotFoundException ex2)
                {
                    Globals.Logger.LogEvent(InfoWorkerEventLogConstants.Tuple_MRMSkippingFolder, null, new object[]
                    {
                        folderList[i][1],
                        ex2.ToString()
                    });
                }
                IL_3A5 :;
            }
            Synchronizer.Tracer.TraceDebug <Synchronizer>((long)this.GetHashCode(), "{0}: Start update parentFolderIdToPropertyMap", this);
            Dictionary <StoreObjectId, Synchronizer.FolderPropertySet> dictionary = new Dictionary <StoreObjectId, Synchronizer.FolderPropertySet>();
            StoreObjectId storeObjectId2 = ((VersionedId)folderList[folderList.Count - 1][0]).ObjectId;

            for (int j = folderList.Count - 1; j >= 0; j--)
            {
                if (((VersionedId)folderList[j][0]).ObjectId.Equals(storeObjectId2))
                {
                    dictionary[storeObjectId2] = new Synchronizer.FolderPropertySet(folderList[j][2], folderList[j][7], (StoreObjectId)folderList[j][5]);
                    storeObjectId2             = (StoreObjectId)folderList[j][5];
                    Synchronizer.Tracer.TraceDebug <Synchronizer, object, StoreObjectId>((long)this.GetHashCode(), "{0}: Add folder {1} (ID: {2}) to parentFolderIdToPropertyMap from current folderList", this, folderList[j][1], storeObjectId2);
                }
            }
            if (this.parentFolderIdToPropertyMap != null)
            {
                Synchronizer.FolderPropertySet folderPropertySet;
                while (this.parentFolderIdToPropertyMap.TryGetValue(storeObjectId2, out folderPropertySet))
                {
                    dictionary[storeObjectId2] = folderPropertySet;
                    storeObjectId2             = folderPropertySet.ParentFolderId;
                    Synchronizer.Tracer.TraceDebug <Synchronizer, StoreObjectId>((long)this.GetHashCode(), "{0}: Add folder (ID: {1}) to parentFolderIdToPropertyMap from previous map", this, storeObjectId2);
                }
            }
            this.parentFolderIdToPropertyMap = dictionary;
        }