コード例 #1
0
        // Token: 0x06000037 RID: 55 RVA: 0x00003A78 File Offset: 0x00001C78
        private void SendExpiryNdrOofNotification(MessageItem messageItem, ApprovalInformation.ApprovalNotificationType notificationType)
        {
            ModeratedDLApplication.diag.TraceDebug((long)this.GetHashCode(), "Entering SendExpiryNdrOofNotification");
            if (!this.ShouldSendNotification(messageItem))
            {
                return;
            }
            RoutingAddress routingAddress;

            if (!this.TryGetOriginalSender(messageItem, out routingAddress))
            {
                return;
            }
            MailboxSession mailboxSession = (MailboxSession)messageItem.Session;

            messageItem.Load(ModeratedDLApplication.NotificationPropertiesFromInitMessage);
            string valueOrDefault = messageItem.GetValueOrDefault <string>(MessageItemSchema.AcceptLanguage, string.Empty);
            ICollection <string> moderatedRecipients = this.GetModeratedRecipients(messageItem, false);
            string valueOrDefault2 = messageItem.GetValueOrDefault <string>(ItemSchema.InternetReferences, string.Empty);
            DsnHumanReadableWriter defaultDsnHumanReadableWriter = DsnHumanReadableWriter.DefaultDsnHumanReadableWriter;
            StoreObjectId          defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.Outbox);

            using (MessageItem messageItem2 = MessageItem.Create(mailboxSession, defaultFolderId))
            {
                ApprovalInformation approvalInformation = null;
                approvalInformation  = defaultDsnHumanReadableWriter.GetMessageInModerationExpiredNdrOofInformation(notificationType, messageItem.Subject, moderatedRecipients, valueOrDefault2, valueOrDefault);
                messageItem2.Subject = approvalInformation.Subject;
                BodyWriteConfiguration configuration = new BodyWriteConfiguration(BodyFormat.TextHtml, approvalInformation.MessageCharset.Name);
                using (Stream stream = messageItem2.Body.OpenWriteStream(configuration))
                {
                    defaultDsnHumanReadableWriter.WriteHtmlModerationBody(stream, approvalInformation);
                }
                this.StampCommonNotificationProperties(messageItem2, messageItem, new RoutingAddress[]
                {
                    routingAddress
                }, valueOrDefault2, approvalInformation.Culture);
                string text;
                this.AttachOriginalMessageToNotification(messageItem, messageItem2, out text);
                messageItem2.ClassName = "IPM.Note.Microsoft.Approval.Reply";
                messageItem2.SendWithoutSavingMessage();
                ModeratedDLApplication.diag.TraceDebug((long)this.GetHashCode(), "Notification sent.");
            }
        }