// Token: 0x06000423 RID: 1059 RVA: 0x0001D818 File Offset: 0x0001BA18
 private bool GetStoreData()
 {
     if (this.configItem == null)
     {
         this.EnsureUserConfigurationIsValid();
     }
     try
     {
         this.storeTagDictionary = MrmFaiFormatter.Deserialize(this.configItem, base.MailboxSession.MailboxOwner, out this.deletedTags, out this.fullCrawlRequired);
         if (this.IsArchiveMailUser)
         {
             foreach (StoreTagData storeTagData in this.storeTagDictionary.Values)
             {
                 bool flag = ElcMailboxHelper.IsArchiveTag(storeTagData, false);
                 if (storeTagData.Tag.Type == ElcFolderType.All && !flag)
                 {
                     foreach (ContentSetting contentSetting in storeTagData.ContentSettings.Values)
                     {
                         if (contentSetting.MessageClass.Equals(ElcMessageClass.AllMailboxContent, StringComparison.CurrentCultureIgnoreCase))
                         {
                             this.defaultAdTag = storeTagData.Tag.RetentionId;
                             break;
                         }
                         if (contentSetting.MessageClass.Equals(ElcMessageClass.VoiceMail, StringComparison.CurrentCultureIgnoreCase))
                         {
                             this.defaultVmAdTag = storeTagData.Tag.RetentionId;
                             break;
                         }
                     }
                 }
             }
             this.defaultContentSettingList = new List <ElcPolicySettings>();
             if (!this.defaultAdTag.Equals(Guid.Empty))
             {
                 foreach (ContentSetting elcContentSetting in this.storeTagDictionary[this.defaultAdTag].ContentSettings.Values)
                 {
                     ElcPolicySettings.ParseContentSettings(this.defaultContentSettingList, elcContentSetting);
                 }
             }
             if (!this.defaultVmAdTag.Equals(Guid.Empty))
             {
                 foreach (ContentSetting elcContentSetting2 in this.storeTagDictionary[this.defaultVmAdTag].ContentSettings.Values)
                 {
                     ElcPolicySettings.ParseContentSettings(this.defaultContentSettingList, elcContentSetting2);
                 }
             }
         }
     }
     catch (ObjectNotFoundException arg)
     {
         ElcUserInformation.Tracer.TraceDebug <ObjectNotFoundException>((long)this.GetHashCode(), "Deserialize of MRM FAI message failed because it could not be found. Exception: {0}", arg);
         return(false);
     }
     return(true);
 }
Beispiel #2
0
 // Token: 0x060003A3 RID: 931 RVA: 0x00019A5C File Offset: 0x00017C5C
 private void LookForNewTagsInAD(TagChange tagChange)
 {
     foreach (Guid key in this.elcUserInfo.TagsInUserPolicy.Keys)
     {
         bool flag  = ElcMailboxHelper.IsArchiveTag(this.elcUserInfo.TagsInUserPolicy[key], false);
         bool flag2 = this.elcUserInfo.MailboxSession.MailboxOwner.MailboxInfo.IsArchive && flag;
         if (!this.elcUserInfo.StoreTagDictionary.ContainsKey(this.elcUserInfo.EffectiveGuidMapping[key]))
         {
             if (this.elcUserInfo.TagsInUserPolicy[key].Tag.Type == ElcFolderType.All && flag)
             {
                 ADChangeDetector.Tracer.TraceDebug <ADChangeDetector, string>((long)this.GetHashCode(), "{0}: LookForNewTagsInAD: Default MTA tag: {1}. Skip checks for this tag.", this, this.elcUserInfo.TagsInUserPolicy[key].Tag.Name);
             }
             else
             {
                 ADChangeDetector.Tracer.TraceDebug <ADChangeDetector, string, ElcFolderType>((long)this.GetHashCode(), "{0}: LookForNewTagsInAD: A new tag '{1}' of type {2} was found in AD.", this, this.elcUserInfo.TagsInUserPolicy[key].Tag.Name, this.elcUserInfo.TagsInUserPolicy[key].Tag.Type);
                 if (this.elcUserInfo.TagsInUserPolicy[key].Tag.Type != ElcFolderType.Personal)
                 {
                     tagChange.ChangeType |= ChangeType.Other;
                 }
                 this.elcUserInfo.StoreTagDictionary[this.elcUserInfo.EffectiveGuidMapping[key]] = new StoreTagData(this.elcUserInfo.TagsInUserPolicy[key]);
                 if (flag2)
                 {
                     ADChangeDetector.Tracer.TraceDebug <ADChangeDetector, string>((long)this.GetHashCode(), "{0}: LookForNewTagsInAD: MTA tag: {1} in the archive mbx. Set IsVisible to false.", this, this.elcUserInfo.TagsInUserPolicy[key].Tag.Name);
                     this.elcUserInfo.StoreTagDictionary[this.elcUserInfo.EffectiveGuidMapping[key]].IsVisible = false;
                 }
                 this.UpdateStoreContentSettings(this.elcUserInfo.EffectiveGuidMapping[key]);
             }
         }
         else
         {
             ADChangeDetector.Tracer.TraceDebug <ADChangeDetector, string, ElcFolderType>((long)this.GetHashCode(), "{0}: LookForNewTagsInAD: Tag '{1}' of type {2} exists in FAI.", this, this.elcUserInfo.TagsInUserPolicy[key].Tag.Name, this.elcUserInfo.TagsInUserPolicy[key].Tag.Type);
             if (this.elcUserInfo.TagsInUserPolicy[key].Tag.Type == ElcFolderType.Personal && !flag2)
             {
                 this.elcUserInfo.StoreTagDictionary[this.elcUserInfo.EffectiveGuidMapping[key]].IsVisible = true;
             }
         }
     }
 }
        // Token: 0x06000419 RID: 1049 RVA: 0x0001D084 File Offset: 0x0001B284
        internal void GetDefaultTagInAD()
        {
            this.defaultAdTag   = Guid.Empty;
            this.defaultVmAdTag = Guid.Empty;
            Guid key  = Guid.Empty;
            Guid key2 = Guid.Empty;

            foreach (AdTagData adTagData in this.tagsInUserPolicy.Values)
            {
                if (adTagData.Tag.Type == ElcFolderType.All)
                {
                    if (ElcMailboxHelper.IsArchiveTag(adTagData, true))
                    {
                        ElcUserInformation.Tracer.TraceDebug <ElcUserTagInformation, string>((long)this.GetHashCode(), "{0}: Default move to archive tag found: {1}", this, adTagData.Tag.Name);
                        this.defaultArchiveAdTag         = adTagData.Tag.RetentionId;
                        this.defaultArchiveTagObjectGuid = adTagData.Tag.Guid;
                        this.archivingEnabled            = true;
                        continue;
                    }
                    if (ElcMailboxHelper.IsArchiveTag(adTagData, false))
                    {
                        continue;
                    }
                    ElcUserInformation.Tracer.TraceDebug <ElcUserTagInformation, string>((long)this.GetHashCode(), "{0}: Default tag found: {1}", this, adTagData.Tag.Name);
                    using (SortedDictionary <Guid, ContentSetting> .ValueCollection.Enumerator enumerator2 = adTagData.ContentSettings.Values.GetEnumerator())
                    {
                        while (enumerator2.MoveNext())
                        {
                            ContentSetting contentSetting = enumerator2.Current;
                            if (contentSetting.MessageClass.Equals(ElcMessageClass.AllMailboxContent, StringComparison.CurrentCultureIgnoreCase))
                            {
                                this.defaultAdTag = adTagData.Tag.RetentionId;
                                key = adTagData.Tag.Guid;
                                this.compactDefaultPolicy = null;
                                break;
                            }
                            if (contentSetting.MessageClass.Equals(ElcMessageClass.VoiceMail, StringComparison.CurrentCultureIgnoreCase))
                            {
                                this.defaultVmAdTag = adTagData.Tag.RetentionId;
                                key2 = adTagData.Tag.Guid;
                                this.compactDefaultPolicy = null;
                                break;
                            }
                        }
                        continue;
                    }
                }
                if (adTagData.Tag.Type != ElcFolderType.RecoverableItems && ElcMailboxHelper.IsArchiveTag(adTagData, true))
                {
                    ElcUserInformation.Tracer.TraceDebug <ElcUserTagInformation, string>((long)this.GetHashCode(), "{0}: Enabled Archive tag found: {1}", this, adTagData.Tag.Name);
                    this.archivingEnabled = true;
                }
            }
            this.defaultContentSettingList = new List <ElcPolicySettings>();
            if (!this.defaultAdTag.Equals(Guid.Empty))
            {
                foreach (ContentSetting elcContentSetting in this.tagsInUserPolicy[key].ContentSettings.Values)
                {
                    ElcPolicySettings.ParseContentSettings(this.defaultContentSettingList, elcContentSetting);
                }
            }
            if (!this.defaultVmAdTag.Equals(Guid.Empty))
            {
                foreach (ContentSetting elcContentSetting2 in this.tagsInUserPolicy[key2].ContentSettings.Values)
                {
                    ElcPolicySettings.ParseContentSettings(this.defaultContentSettingList, elcContentSetting2);
                }
            }
            if (!this.defaultArchiveAdTag.Equals(Guid.Empty))
            {
                this.storeDefaultArchiveTagDictionary = new Dictionary <Guid, StoreTagData>();
                this.storeDefaultArchiveTagDictionary[this.defaultArchiveAdTag] = new StoreTagData(this.tagsInUserPolicy[this.defaultArchiveTagObjectGuid]);
                this.defaultArchiveContentSettingList = new List <ElcPolicySettings>();
                foreach (ContentSetting elcContentSetting3 in this.tagsInUserPolicy[this.defaultArchiveTagObjectGuid].ContentSettings.Values)
                {
                    ElcPolicySettings.ParseContentSettings(this.defaultArchiveContentSettingList, elcContentSetting3);
                }
            }
        }