// Token: 0x060002B6 RID: 694 RVA: 0x000108F8 File Offset: 0x0000EAF8 private void CompleteReport(TagExpirationExecutor tagExpirationExecutor, RetentionActionType retention) { if (!tagExpirationExecutor.ELCReport.ContainsKey(retention)) { tagExpirationExecutor.ELCReport.Add(retention, new List <List <object> >()); } }
/// <summary> /// Constructor for retention policy tag. /// </summary> /// <param name="displayName">Display name.</param> /// <param name="retentionId">Retention id.</param> /// <param name="retentionPeriod">Retention period.</param> /// <param name="type">Retention folder type.</param> /// <param name="retentionAction">Retention action.</param> /// <param name="isVisible">Is visible.</param> /// <param name="optedInto">Opted into.</param> /// <param name="isArchive">Is archive tag.</param> internal RetentionPolicyTag( string displayName, Guid retentionId, int retentionPeriod, ElcFolderType type, RetentionActionType retentionAction, bool isVisible, bool optedInto, bool isArchive) { DisplayName = displayName; RetentionId = retentionId; RetentionPeriod = retentionPeriod; Type = type; RetentionAction = retentionAction; IsVisible = isVisible; OptedInto = optedInto; IsArchive = isArchive; }
/// <summary> /// Constructor for retention policy tag. /// </summary> /// <param name="displayName">Display name.</param> /// <param name="retentionId">Retention id.</param> /// <param name="retentionPeriod">Retention period.</param> /// <param name="type">Retention folder type.</param> /// <param name="retentionAction">Retention action.</param> /// <param name="isVisible">Is visible.</param> /// <param name="optedInto">Opted into.</param> /// <param name="isArchive">Is archive tag.</param> internal RetentionPolicyTag( string displayName, Guid retentionId, int retentionPeriod, ElcFolderType type, RetentionActionType retentionAction, bool isVisible, bool optedInto, bool isArchive) { DisplayName = displayName; RetentionId = retentionId; RetentionPeriod = retentionPeriod; Type = type; RetentionAction = retentionAction; IsVisible = isVisible; OptedInto = optedInto; IsArchive = isArchive; }
private string GetLocalizedRetentionAction(bool retentionEnabled, RetentionActionType retentionActionType) { string result = LocalizedDescriptionAttribute.FromEnum(typeof(RetentionActionType), retentionActionType); bool flag = retentionActionType == RetentionActionType.MoveToArchive; if (retentionActionType == RetentionActionType.DeleteAndAllowRecovery) { result = OwaOptionStrings.RetentionActionDeleteAndAllowRecovery; } if (!retentionEnabled) { if (flag) { result = OwaOptionStrings.RetentionActionNeverMove; } else { result = OwaOptionStrings.RetentionActionNeverDelete; } } return result; }
public static void PopulateRetentionActions(RadioButtonList rblRetentionAction, bool includeArchive) { RetentionActionType[] array = new RetentionActionType[] { RetentionActionType.DeleteAndAllowRecovery, RetentionActionType.PermanentlyDelete, RetentionActionType.MoveToArchive }; foreach (RetentionActionType retentionActionType in array) { if (RetentionActionType.MoveToArchive != retentionActionType || includeArchive) { string value = string.Empty; switch (retentionActionType) { case RetentionActionType.DeleteAndAllowRecovery: value = Strings.RetentionActionEnumDeleteAndAllowRecovery; break; case RetentionActionType.PermanentlyDelete: value = Strings.RetentionActionEnumPermanentlyDelete; break; case RetentionActionType.MoveToArchive: value = Strings.RetentionActionEnumMoveToArchive; break; } string value2 = retentionActionType.ToString(); ListItem item = new ListItem(RtlUtil.ConvertToDecodedBidiString(value, RtlUtil.IsRtl), value2); rblRetentionAction.Items.Add(item); } } if (rblRetentionAction.Items.Count > 0) { rblRetentionAction.Items[0].Selected = true; } }
internal static PolicyTagList GetPolicyTagListFromMailboxSession(RetentionActionType type, MailboxSession session) { StoreId defaultFolderId = session.GetDefaultFolderId(DefaultFolderType.Inbox); IReadableUserConfiguration readableUserConfiguration = null; try { readableUserConfiguration = session.UserConfigurationManager.GetReadOnlyFolderConfiguration("MRM", UserConfigurationTypes.Stream | UserConfigurationTypes.XML | UserConfigurationTypes.Dictionary, defaultFolderId); if (readableUserConfiguration != null) { using (Stream xmlStream = readableUserConfiguration.GetXmlStream()) { string sessionCultureName = null; if (session.Capabilities.CanHaveCulture) { sessionCultureName = session.PreferedCulture.Name; } return(PolicyTagList.GetPolicyTakListFromXmlStream(type, xmlStream, sessionCultureName)); } } } catch (ObjectNotFoundException) { } catch (CorruptDataException) { } finally { if (readableUserConfiguration != null) { readableUserConfiguration.Dispose(); } } return(null); }
public static string GetLocalizedRetentionActionType(RetentionActionType retentionActionType) { return((retentionActionType == RetentionActionType.MoveToArchive) ? Strings.RetentionActionTypeArchive : Strings.RetentionActionTypeDelete); }
// Token: 0x060001C7 RID: 455 RVA: 0x0000C2B4 File Offset: 0x0000A4B4 protected void AddToReport(RetentionActionType policy, object[] itemProperties, PropertyIndexHolder propertyIndexHolder, Dictionary <Guid, string> allPolicyTags) { try { if (this.isReportEnabled) { object propertyObject = this.GetPropertyObject(itemProperties[propertyIndexHolder.ConversationTopic]); object propertyObject2 = this.GetPropertyObject(itemProperties[propertyIndexHolder.MessageSenderDisplayName]); object propertyObject3 = this.GetPropertyObject(itemProperties[propertyIndexHolder.ParentDisplayName]); object propertyObject4 = this.GetPropertyObject(itemProperties[propertyIndexHolder.ReceivedTimeIndex]); object propertyObject5 = this.GetPropertyObject(itemProperties[propertyIndexHolder.LastModifiedTime]); Guid key = (itemProperties[propertyIndexHolder.PolicyTagIndex] is PropertyError) ? Guid.Empty : new Guid((byte[])itemProperties[propertyIndexHolder.PolicyTagIndex]); Guid key2 = (itemProperties[propertyIndexHolder.ArchiveTagIndex] is PropertyError) ? Guid.Empty : new Guid((byte[])itemProperties[propertyIndexHolder.ArchiveTagIndex]); bool flag = (!(itemProperties[propertyIndexHolder.MessageToMe] is PropertyError) && (bool)itemProperties[propertyIndexHolder.MessageToMe]) || (!(itemProperties[propertyIndexHolder.MessageCcMe] is PropertyError) && (bool)itemProperties[propertyIndexHolder.MessageCcMe]); object obj = key.Equals(Guid.Empty) ? Strings.ElcEmailDefaultTag : (allPolicyTags.ContainsKey(key) ? allPolicyTags[key] : Strings.ElcEmailUnknownTag); object obj2 = key2.Equals(Guid.Empty) ? Strings.ElcEmailDefaultTag : (allPolicyTags.ContainsKey(key2) ? allPolicyTags[key2] : Strings.ElcEmailUnknownTag); object item = null; object item2 = null; if (policy.Equals(RetentionActionType.MoveToArchive)) { item = obj2; item2 = obj; } else { item = obj; item2 = obj2; } if (!this.ELCReport.ContainsKey(policy)) { this.ELCReport.Add(policy, new List <List <object> >()); } if (this.ELCReport[policy].Count < ElcGlobals.ReportItemLimit) { foreach (List <object> list in this.ELCReport[policy]) { if (list[0].Equals(itemProperties[propertyIndexHolder.ConversationId])) { if (((ExDateTime)propertyObject4).CompareTo(list[4]) < 0) { list[2] = propertyObject2; list[3] = propertyObject3; list[6] = propertyObject4; list[7] = propertyObject5; list[8] = (int)list[8] + 1; } return; } } List <object> list2 = new List <object>(9); list2.Add(itemProperties[propertyIndexHolder.ConversationId]); list2.Add(propertyObject); list2.Add(propertyObject2); list2.Add(propertyObject3); list2.Add(item); list2.Add(item2); list2.Add(propertyObject4); list2.Add(propertyObject5); list2.Add(1); if (flag) { this.ELCReport[policy].Insert(0, list2); this.separationIndices[policy] = this.separationIndices[policy] + 1; } else { this.ELCReport[policy].Add(list2); } } else { foreach (List <object> list3 in this.ELCReport[policy]) { if (list3[0].Equals(itemProperties[propertyIndexHolder.ConversationId])) { if (((ExDateTime)itemProperties[propertyIndexHolder.ReceivedTimeIndex]).CompareTo(list3[6]) < 0) { list3[2] = propertyObject2; list3[3] = propertyObject3; list3[6] = propertyObject4; list3[7] = propertyObject5; list3[8] = (int)list3[8] + 1; } return; } } if (this.separationIndices[policy] < ElcGlobals.ReportItemLimit) { if (flag) { List <object> list4 = new List <object>(9); list4.Add(itemProperties[propertyIndexHolder.ConversationId]); list4.Add(propertyObject); list4.Add(propertyObject2); list4.Add(propertyObject3); list4.Add(item); list4.Add(item2); list4.Add(propertyObject4); list4.Add(propertyObject5); list4.Add(1); this.ELCReport[policy][this.separationIndices[policy]] = list4; this.separationIndices[policy] = this.separationIndices[policy] + 1; this.elcReportOverflow = true; } else { this.elcReportOverflow = true; } } else { this.elcReportOverflow = true; } } } } catch (IndexOutOfRangeException ex) { this.tracer.TraceError <ExpirationExecutor>((long)this.GetHashCode(), "{0}: Didn't receive a parameter for an item that's being reported: " + ex.Message, this); StatisticsLogEntry statisticsLogEntry = this.MailboxData.StatisticsLogEntry; statisticsLogEntry.ExceptionType += ex.GetType(); this.MailboxData.StatisticsLogEntry.AddExceptionToLog(ex); } finally { if (this.ELCReport.ContainsKey(policy) && this.ELCReport[policy].Count == 0) { this.ELCReport.Remove(policy); } } }
protected override void InternalValidate() { TaskLogger.LogEnter(); if (!base.Fields.Contains("Mailbox")) { SharedConfigurationTaskHelper.VerifyIsNotTinyTenant(base.CurrentOrgState, new Task.ErrorLoggerDelegate(base.WriteError)); } if (base.ParameterSetName == "ParameterSetMailboxTask") { return; } if (base.Fields.IsModified("LegacyManagedFolder")) { if (this.LegacyManagedFolder != null) { ELCFolder elcfolder = (ELCFolder)base.GetDataObject <ELCFolder>(this.LegacyManagedFolder, base.DataSession, null, new LocalizedString?(Strings.ErrorElcFolderNotFound(this.LegacyManagedFolder.ToString())), new LocalizedString?(Strings.ErrorAmbiguousElcFolderId(this.LegacyManagedFolder.ToString()))); this.DataObject.LegacyManagedFolder = elcfolder.Id; } else { this.DataObject.LegacyManagedFolder = null; } } base.InternalValidate(); if (this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.RetentionAction)) { RetentionActionType[] source = new RetentionActionType[] { RetentionActionType.MoveToFolder }; if (source.Any((RetentionActionType x) => x == this.contentSettingsObject.RetentionAction)) { base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorRetentionActionNowAllowed), ErrorCategory.InvalidOperation, null); } if (this.DataObject.Type == ElcFolderType.RecoverableItems && !this.contentSettingsObject.RetentionAction.Equals(RetentionActionType.MoveToArchive)) { base.WriteError(new ArgumentException(Strings.ErrorDumpsterTagWrongRetentionAction), ErrorCategory.InvalidArgument, this); } if (this.DataObject.Type != ElcFolderType.All && this.DataObject.Type != ElcFolderType.Personal && this.DataObject.Type != ElcFolderType.RecoverableItems && this.RetentionAction == RetentionActionType.MoveToArchive) { base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorMoveToArchiveAppliedToSystemFolder), ErrorCategory.InvalidArgument, null); } } if (this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.MessageClass) && this.DataObject.Type != ElcFolderType.All && !this.contentSettingsObject.MessageClass.Equals(ElcMessageClass.AllMailboxContent)) { base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorOnlyDefaultTagAllowCustomizedMessageClass), ErrorCategory.InvalidOperation, this.DataObject); } string tagName; if (this.DataObject.IsChanged(RetentionPolicyTagSchema.RetentionId) && !(base.DataSession as IConfigurationSession).CheckForRetentionTagWithConflictingRetentionId(this.DataObject.RetentionId, this.DataObject.Identity.ToString(), out tagName)) { base.WriteError(new RetentionPolicyTagTaskException(Strings.ErrorRetentionIdConflictsWithRetentionTag(this.DataObject.RetentionId.ToString(), tagName)), ErrorCategory.InvalidOperation, this.DataObject); } if (this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.RetentionAction) || this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.RetentionEnabled) || this.contentSettingsObject.IsChanged(ElcContentSettingsSchema.MessageClass)) { this.ValidateRetentionPolicy(); } if (base.Fields.IsModified("AddressForJournaling")) { if (this.AddressForJournaling != null) { ADRecipient adrecipient = (ADRecipient)base.GetDataObject <ADRecipient>(this.AddressForJournaling, base.TenantGlobalCatalogSession, null, new LocalizedString?(Strings.ErrorMailboxAddressNotFound(this.AddressForJournaling.ToString())), new LocalizedString?(Strings.ErrorMailboxAddressNotUnique(this.AddressForJournaling.ToString()))); if (!this.DataObject.OrganizationId.Equals(OrganizationId.ForestWideOrgId)) { RecipientTaskHelper.CheckRecipientInSameOrganizationWithDataObject(this.DataObject, adrecipient, new Task.ErrorLoggerDelegate(base.WriteError)); } if (adrecipient.EmailAddresses == null || adrecipient.EmailAddresses.FindPrimary(ProxyAddressPrefix.Smtp) == null) { base.WriteError(new ArgumentException(Strings.SmtpAddressMissingForAutocopy(this.AddressForJournaling.ToString()), "AddressForJournaling"), ErrorCategory.InvalidData, this); } this.contentSettingsObject.AddressForJournaling = adrecipient.Id; } else { this.contentSettingsObject.AddressForJournaling = null; } } ValidationError[] array = this.contentSettingsObject.Validate(); if (array.Length > 0) { for (int i = 0; i < array.Length; i++) { this.WriteError(new DataValidationException(array[i]), (ErrorCategory)1003, this.contentSettingsObject.Identity, array.Length - 1 == i); } } if (base.HasErrors) { return; } TaskLogger.LogExit(); }
internal static PolicyTagList GetPolicyTakListFromXmlStream(RetentionActionType type, Stream xmlStream, string sessionCultureName) { PolicyTagList policyTagList = new PolicyTagList(); if (xmlStream.Length == 0L) { return(policyTagList); } using (XmlTextReader xmlTextReader = SafeXmlFactory.CreateSafeXmlTextReader(xmlStream)) { try { xmlTextReader.MoveToContent(); while ((xmlTextReader.NodeType != XmlNodeType.Element || (string.CompareOrdinal(xmlTextReader.Name, "PolicyTag") != 0 && string.CompareOrdinal(xmlTextReader.Name, "ArchiveTag") != 0 && string.CompareOrdinal(xmlTextReader.Name, "DefaultArchiveTag") != 0)) && xmlTextReader.Read()) { } for (;;) { bool flag = string.CompareOrdinal(xmlTextReader.Name, "PolicyTag") == 0; bool flag2 = string.CompareOrdinal(xmlTextReader.Name, "ArchiveTag") == 0 || string.CompareOrdinal(xmlTextReader.Name, "DefaultArchiveTag") == 0; if (!flag && !flag2) { break; } PolicyTag policyTag = new PolicyTag(); policyTag.IsArchive = flag2; if (xmlTextReader.MoveToAttribute("Guid")) { policyTag.PolicyGuid = new Guid(xmlTextReader.Value); } if (xmlTextReader.MoveToAttribute("Name")) { policyTag.Name = xmlTextReader.Value; } if (xmlTextReader.MoveToAttribute("Comment")) { policyTag.Description = xmlTextReader.Value; } if (xmlTextReader.MoveToAttribute("Type")) { string value; switch (value = xmlTextReader.Value) { case "Calendar": policyTag.Type = ElcFolderType.Calendar; goto IL_341; case "Contacts": policyTag.Type = ElcFolderType.Contacts; goto IL_341; case "DeletedItems": policyTag.Type = ElcFolderType.DeletedItems; goto IL_341; case "Drafts": policyTag.Type = ElcFolderType.Drafts; goto IL_341; case "Inbox": policyTag.Type = ElcFolderType.Inbox; goto IL_341; case "JunkEmail": policyTag.Type = ElcFolderType.JunkEmail; goto IL_341; case "Journal": policyTag.Type = ElcFolderType.Journal; goto IL_341; case "Notes": policyTag.Type = ElcFolderType.Notes; goto IL_341; case "Outbox": policyTag.Type = ElcFolderType.Outbox; goto IL_341; case "SentItems": policyTag.Type = ElcFolderType.SentItems; goto IL_341; case "Tasks": policyTag.Type = ElcFolderType.Tasks; goto IL_341; case "All": policyTag.Type = ElcFolderType.All; goto IL_341; case "ManagedCustomFolder": policyTag.Type = ElcFolderType.ManagedCustomFolder; goto IL_341; case "RssSubscriptions": policyTag.Type = ElcFolderType.RssSubscriptions; goto IL_341; case "SyncIssues": policyTag.Type = ElcFolderType.SyncIssues; goto IL_341; case "ConversationHistory": policyTag.Type = ElcFolderType.ConversationHistory; goto IL_341; } policyTag.Type = ElcFolderType.Personal; } IL_341: if (xmlTextReader.MoveToAttribute("IsVisible")) { policyTag.IsVisible = bool.Parse(xmlTextReader.Value); } if (xmlTextReader.MoveToAttribute("OptedInto")) { policyTag.OptedInto = bool.Parse(xmlTextReader.Value); } while (string.CompareOrdinal(xmlTextReader.Name, "ContentSettings") != 0 && string.CompareOrdinal(xmlTextReader.Name, "PolicyTag") != 0 && string.CompareOrdinal(xmlTextReader.Name, "ArchiveTag") != 0) { if (string.CompareOrdinal(xmlTextReader.Name, "DefaultArchiveTag") == 0) { break; } if (!xmlTextReader.Read()) { break; } if (!string.IsNullOrEmpty(sessionCultureName)) { if (string.CompareOrdinal(xmlTextReader.Name, "LocalizedName") == 0) { xmlTextReader.Read(); bool flag3 = false; while (string.CompareOrdinal(xmlTextReader.Name, "LocalizedName") != 0) { if (!flag3 && !string.IsNullOrEmpty(xmlTextReader.Value)) { string stringFromLocalizedStringPair = PolicyTagList.GetStringFromLocalizedStringPair(sessionCultureName, xmlTextReader.Value); if (stringFromLocalizedStringPair != null) { policyTag.Name = stringFromLocalizedStringPair; flag3 = true; } } if (!xmlTextReader.Read()) { break; } } } if (string.CompareOrdinal(xmlTextReader.Name, "LocalizedComment") == 0) { xmlTextReader.Read(); bool flag4 = false; while (string.CompareOrdinal(xmlTextReader.Name, "LocalizedComment") != 0) { if (!flag4 && !string.IsNullOrEmpty(xmlTextReader.Value)) { string stringFromLocalizedStringPair2 = PolicyTagList.GetStringFromLocalizedStringPair(sessionCultureName, xmlTextReader.Value); if (stringFromLocalizedStringPair2 != null) { policyTag.Description = stringFromLocalizedStringPair2; flag4 = true; } } if (!xmlTextReader.Read()) { break; } } } } } while (string.CompareOrdinal(xmlTextReader.Name, "ContentSettings") == 0) { if (xmlTextReader.MoveToAttribute("ExpiryAgeLimit")) { policyTag.TimeSpanForRetention = EnhancedTimeSpan.FromDays(double.Parse(xmlTextReader.Value)); } if (xmlTextReader.MoveToAttribute("RetentionAction")) { policyTag.RetentionAction = (RetentionActionType)Enum.Parse(typeof(RetentionActionType), xmlTextReader.Value, true); } xmlTextReader.Read(); } if (type == (RetentionActionType)0 || (type == RetentionActionType.MoveToArchive && flag2) || (type != (RetentionActionType)0 && type != RetentionActionType.MoveToArchive && flag)) { policyTagList[policyTag.PolicyGuid] = policyTag; } if ((string.CompareOrdinal(xmlTextReader.Name, "PolicyTag") == 0 || string.CompareOrdinal(xmlTextReader.Name, "ArchiveTag") == 0 || string.CompareOrdinal(xmlTextReader.Name, "DefaultArchiveTag") == 0) && xmlTextReader.NodeType == XmlNodeType.EndElement) { xmlTextReader.Read(); } } } catch (XmlException ex) { } catch (ArgumentException ex2) { } catch (FormatException ex3) { } } return(policyTagList); }
private ElcContentSettings[] GetUpgradedConentSettings(ElcContentSettings[] folderContentSettings, bool defaultTag) { List <ElcContentSettings> upgradedSettings = new List <ElcContentSettings>(); ElcContentSettings[] array = (from x in folderContentSettings where x.RetentionEnabled || x.JournalingEnabled select x).ToArray <ElcContentSettings>(); folderContentSettings.Except(array).ForEach(delegate(ElcContentSettings x) { this.WriteWarning(Strings.CouldNotUpgradeDisabledContentSettings(x.Name)); }); RetentionActionType[] allowedRetentionActions = new RetentionActionType[] { RetentionActionType.PermanentlyDelete, RetentionActionType.DeleteAndAllowRecovery, RetentionActionType.MoveToDeletedItems }; if (!defaultTag) { ElcContentSettings elcContentSettings = new ElcContentSettings(); elcContentSettings.JournalingEnabled = false; elcContentSettings.RetentionEnabled = false; elcContentSettings.RetentionAction = RetentionActionType.PermanentlyDelete; ElcContentSettings[] array2 = (from x in array where x.RetentionEnabled select x).ToArray <ElcContentSettings>(); ElcContentSettings[] array3 = (from x in array2 where allowedRetentionActions.Any((RetentionActionType y) => x.RetentionAction == y) select x).ToArray <ElcContentSettings>(); array2.Except(array3).ForEach(delegate(ElcContentSettings x) { this.WriteWarning(Strings.CouldNotUpgradeSpecificContentSetting(x.Name)); }); ElcContentSettings[] array4 = (from x in array3 where x.TriggerForRetention == RetentionDateType.WhenDelivered select x).ToArray <ElcContentSettings>(); array3.Except(array4).ForEach(delegate(ElcContentSettings x) { this.WriteWarning(Strings.CouldNotUpgradeRetentionTrigger(x.TriggerForRetention.ToString(), x.Name, RetentionDateType.WhenDelivered.ToString())); }); array4.Aggregate(elcContentSettings, delegate(ElcContentSettings a, ElcContentSettings x) { if (a.AgeLimitForRetention == null) { a.AgeLimitForRetention = x.AgeLimitForRetention; } else if (x.AgeLimitForRetention != null && a.AgeLimitForRetention < x.AgeLimitForRetention) { a.AgeLimitForRetention = x.AgeLimitForRetention; } if (Array.FindIndex <RetentionActionType>(allowedRetentionActions, (RetentionActionType y) => y == a.RetentionAction) < Array.FindIndex <RetentionActionType>(allowedRetentionActions, (RetentionActionType y) => y == x.RetentionAction)) { a.RetentionAction = x.RetentionAction; } a.RetentionEnabled = true; return(a); }); if (elcContentSettings.RetentionEnabled) { elcContentSettings.TriggerForRetention = RetentionDateType.WhenDelivered; elcContentSettings.MessageClass = ElcMessageClass.AllMailboxContent; (from x in array4 where string.Compare(x.MessageClass, ElcMessageClass.AllMailboxContent, StringComparison.OrdinalIgnoreCase) != 0 select x).ForEach(delegate(ElcContentSettings x) { this.WriteWarning(Strings.ChangedMessageClass(x.Name, x.MessageClass)); }); } ElcContentSettings[] array5 = (from x in array where x.JournalingEnabled select x).ToArray <ElcContentSettings>(); if (array5.Length > 0) { elcContentSettings.JournalingEnabled = true; elcContentSettings.MessageFormatForJournaling = array5[0].MessageFormatForJournaling; elcContentSettings.AddressForJournaling = array5[0].AddressForJournaling; elcContentSettings.LabelForJournaling = array5[0].LabelForJournaling; array5.Skip(1).ForEach(delegate(ElcContentSettings x) { this.WriteWarning(Strings.CouldNotUpgradeJournaling(x.Name)); }); } if (elcContentSettings.RetentionEnabled || elcContentSettings.JournalingEnabled) { upgradedSettings.Add(elcContentSettings); } } else { array.ForEach(delegate(ElcContentSettings x) { ElcContentSettings elcContentSettings2 = new ElcContentSettings(); if (x.RetentionEnabled) { if (allowedRetentionActions.Any((RetentionActionType y) => x.RetentionAction == y)) { if (x.TriggerForRetention != RetentionDateType.WhenDelivered) { this.WriteWarning(Strings.CouldNotUpgradeRetentionTrigger(x.TriggerForRetention.ToString(), x.Name, RetentionDateType.WhenDelivered.ToString())); } else { elcContentSettings2.RetentionAction = x.RetentionAction; elcContentSettings2.AgeLimitForRetention = x.AgeLimitForRetention; elcContentSettings2.TriggerForRetention = RetentionDateType.WhenDelivered; elcContentSettings2.RetentionEnabled = x.RetentionEnabled; if (x.MessageClass.Equals(ElcMessageClass.AllMailboxContent, StringComparison.OrdinalIgnoreCase) || x.MessageClass.Equals(ElcMessageClass.VoiceMail, StringComparison.OrdinalIgnoreCase)) { elcContentSettings2.MessageClass = x.MessageClass; } else { elcContentSettings2.MessageClass = ElcMessageClass.AllMailboxContent; this.WriteWarning(Strings.ChangedMessageClass(x.Name, x.MessageClass)); } } } else { this.WriteWarning(Strings.CouldNotUpgradeSpecificContentSetting(x.Name)); } } if (x.JournalingEnabled) { elcContentSettings2.MessageFormatForJournaling = x.MessageFormatForJournaling; elcContentSettings2.JournalingEnabled = x.JournalingEnabled; elcContentSettings2.AddressForJournaling = x.AddressForJournaling; elcContentSettings2.LabelForJournaling = x.LabelForJournaling; if (x.MessageClass.Equals(ElcMessageClass.AllMailboxContent, StringComparison.OrdinalIgnoreCase) || x.MessageClass.Equals(ElcMessageClass.VoiceMail, StringComparison.OrdinalIgnoreCase)) { elcContentSettings2.MessageClass = x.MessageClass; } else { elcContentSettings2.MessageClass = ElcMessageClass.AllMailboxContent; this.WriteWarning(Strings.ChangedMessageClass(x.Name, x.MessageClass)); } } if (elcContentSettings2.RetentionEnabled || elcContentSettings2.JournalingEnabled) { upgradedSettings.Add(elcContentSettings2); } }); } return(upgradedSettings.ToArray()); }
// Token: 0x0600037E RID: 894 RVA: 0x00018700 File Offset: 0x00016900 private void AddToPolicyTagCollection(MailboxDataForFolders mailboxData, Dictionary <Guid, string> allPolicyTagsRet, RetentionActionType retention) { Dictionary <Guid, PolicyTag> policyTagList = mailboxData.MailboxSession.GetPolicyTagList(retention); if (policyTagList != null) { foreach (KeyValuePair <Guid, PolicyTag> keyValuePair in policyTagList) { if (!allPolicyTagsRet.ContainsKey(keyValuePair.Key)) { allPolicyTagsRet.Add(keyValuePair.Key, keyValuePair.Value.Name); } } policyTagList.Clear(); } }