Exemplo n.º 1
0
        // Token: 0x06000573 RID: 1395 RVA: 0x0002B388 File Offset: 0x00029588
        protected void SetInfobarMessages()
        {
            if (!this.isCalendarItem)
            {
                RenderingUtilities.RenderReplyForwardMessageStatus(base.Item, base.Infobar, base.UserContext);
                if (this.isDelegated)
                {
                    base.Infobar.AddMessageText(string.Format(LocalizedStrings.GetNonEncoded(this.delegateMessage), MeetingUtilities.GetReceivedOnBehalfOfDisplayName((MeetingMessage)base.Item)), InfobarMessageType.Informational);
                }
            }
            object obj = base.Item.TryGetProperty(MessageItemSchema.IsDraft);

            if (obj is bool && (bool)obj)
            {
                if (ObjectClass.IsMeetingResponse(this.ItemType))
                {
                    base.Infobar.AddMessageLocalized(-1981719796, InfobarMessageType.Informational);
                }
            }
            else
            {
                InfobarMessageBuilder.AddImportance(base.Infobar, base.Item);
                InfobarMessageBuilder.AddSensitivity(base.Infobar, base.Item);
            }
            InfobarMessageBuilder.AddFlag(base.Infobar, base.Item, base.UserContext);
        }
Exemplo n.º 2
0
 // Token: 0x06002B10 RID: 11024 RVA: 0x000F23E2 File Offset: 0x000F05E2
 private void AddIrmMessageToInfobar()
 {
     if (base.UserContext.IsIrmEnabled && Utilities.IsIrmRestrictedAndDecrypted(this.Message))
     {
         InfobarMessageBuilder.AddIrmInformation(this.infobar, this.Message, base.IsPreviewForm, true, this.IrmItemHelper.IsRemoveAllowed, false);
     }
 }
Exemplo n.º 3
0
 // Token: 0x06002ACD RID: 10957 RVA: 0x000F0D34 File Offset: 0x000EEF34
 protected override void OnLoad(EventArgs e)
 {
     ExTraceGlobals.ContactsCallTracer.TraceDebug((long)this.GetHashCode(), "ReadDistributionList.OnLoad");
     base.OnLoad(e);
     this.distributionList = base.Initialize <DistributionList>(ReadDistributionList.prefetchProperties);
     InfobarMessageBuilder.AddFlag(this.infobar, base.Item, base.UserContext);
     InfobarMessageBuilder.AddNoEditPermissionWarning(this.infobar, this.distributionList, base.IsPreviewForm);
 }
Exemplo n.º 4
0
 // Token: 0x06002A9F RID: 10911 RVA: 0x000EF134 File Offset: 0x000ED334
 protected override void OnLoad(EventArgs e)
 {
     ExTraceGlobals.ContactsCallTracer.TraceDebug((long)this.GetHashCode(), "ReadContact.OnLoad");
     base.OnLoad(e);
     this.contact = base.Initialize <Contact>(ReadContact.prefetchProperties);
     InfobarMessageBuilder.AddFlag(this.infobar, this.contact, base.UserContext);
     InfobarMessageBuilder.AddNoEditPermissionWarning(this.infobar, this.contact, base.IsPreviewForm);
     this.isPhoneticNamesEnabled = Utilities.IsJapanese;
 }
Exemplo n.º 5
0
        // Token: 0x06002B6F RID: 11119 RVA: 0x000F3A30 File Offset: 0x000F1C30
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Message = base.Initialize <MessageItem>(new PropertyDefinition[]
            {
                MessageItemSchema.IsRead,
                BodySchema.Codepage,
                BodySchema.InternetCpid,
                MessageItemSchema.MessageAudioNotes,
                MessageItemSchema.SenderTelephoneNumber,
                ItemSchema.FlagStatus,
                ItemSchema.FlagCompleteTime,
                MessageItemSchema.ReplyTime,
                MessageItemSchema.RequireProtectedPlayOnPhone,
                ItemSchema.UtcDueDate,
                ItemSchema.UtcStartDate,
                ItemSchema.ReminderDueBy,
                ItemSchema.ReminderIsSet,
                StoreObjectSchema.EffectiveRights
            });
            this.IrmItemHelper = new IRMItemHelper(this.Message, base.UserContext, base.IsPreviewForm, base.IsEmbeddedItem);
            using (UMClientCommon umclientCommon = new UMClientCommon(base.UserContext.ExchangePrincipal))
            {
                this.isUMEnabled          = umclientCommon.IsUMEnabled();
                this.isPlayOnPhoneEnabled = umclientCommon.IsPlayOnPhoneEnabled();
            }
            this.IrmItemHelper.IrmDecryptIfRestricted();
            bool isSuspectedPhishingItem = false;
            bool isLinkEnabled           = false;
            bool flag = false;

            this.isMacintoshPlatform = (Utilities.GetBrowserPlatform(base.Request.UserAgent) == BrowserPlatform.Macintosh);
            JunkEmailUtilities.GetJunkEmailPropertiesForItem(this.Message, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkEmailFolder, out isSuspectedPhishingItem, out isLinkEnabled, out flag);
            this.toolbar             = new ReadMessageToolbar(base.IsInDeleteItems, base.IsEmbeddedItem, this.Message, this.isInJunkEmailFolder, isSuspectedPhishingItem, isLinkEnabled, false, this.IrmItemHelper.IsReplyRestricted, this.IrmItemHelper.IsReplyAllRestricted, this.IrmItemHelper.IsForwardRestricted, this.IrmItemHelper.IsPrintRestricted);
            this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
            this.recipientWell       = new MessageRecipientWell(this.Message);
            if (flag)
            {
                this.bodyMarkup = Markup.PlainText;
            }
            InfobarMessageBuilder.AddImportance(this.infobar, this.Message);
            InfobarMessageBuilder.AddFlag(this.infobar, this.Message, base.UserContext);
            InfobarMessageBuilder.AddSensitivity(this.infobar, this.Message);
            if (base.UserContext.IsIrmEnabled && Utilities.IsIrmRestrictedAndDecrypted(this.Message))
            {
                InfobarMessageBuilder.AddIrmInformation(this.infobar, this.Message, base.IsPreviewForm, false, false, false);
            }
            if (!this.Message.IsRead && !base.IsPreviewForm && !base.IsEmbeddedItem)
            {
                this.Message.MarkAsRead(Utilities.ShouldSuppressReadReceipt(base.UserContext, this.Message), false);
            }
        }
 // Token: 0x06002808 RID: 10248 RVA: 0x000E2B68 File Offset: 0x000E0D68
 protected override void OnLoad(EventArgs e)
 {
     ExTraceGlobals.ContactsCallTracer.TraceDebug((long)this.GetHashCode(), "EditDistributionList.OnLoad");
     base.OnLoad(e);
     this.distributionList = base.Initialize <DistributionList>(false, EditDistributionList.prefetchProperties);
     this.listView         = new DistributionListMemberListView(base.UserContext, this.distributionList, ColumnId.MemberDisplayName, SortOrder.Ascending);
     if (this.distributionList != null)
     {
         InfobarMessageBuilder.AddFlag(this.infobar, base.Item, base.UserContext);
     }
     this.toolbar       = new EditDistributionListToolbar(this.distributionList);
     this.recipientWell = new MessageRecipientWell();
 }
Exemplo n.º 7
0
 private void RenderMessage()
 {
     if (this.message != null)
     {
         base.CreateAttachmentHelpers(AttachmentWellType.ReadWrite);
         InfobarMessageBuilder.AddSensitivity(base.Infobar, this.message);
         this.message.Load(EditMessage.prefetchProperties);
         InfobarMessageBuilder.AddCompliance(base.UserContext, base.Infobar, this.message, true);
     }
     this.recipientWell  = new MessageRecipientWell(base.UserContext, this.message);
     this.hasRecipients |= this.recipientWell.HasRecipients(RecipientWellType.To);
     this.hasRecipients |= this.recipientWell.HasRecipients(RecipientWellType.Cc);
     this.hasRecipients |= this.recipientWell.HasRecipients(RecipientWellType.Bcc);
 }
        public void GetComplianceInfobar()
        {
            string g     = (string)base.GetParameter("cguid");
            Guid   empty = Guid.Empty;

            if (GuidHelper.TryParseGuid(g, out empty))
            {
                InfobarMessage compliance = InfobarMessageBuilder.GetCompliance(base.UserContext, empty);
                if (compliance != null)
                {
                    Infobar.RenderMessage(this.Writer, compliance, base.UserContext);
                }
            }
        }
Exemplo n.º 9
0
 internal void HandleReadReceipt(MessageItem message)
 {
     if (message == null)
     {
         throw new ArgumentNullException("message");
     }
     if (Utilities.GetQueryStringParameter(base.Request, "sndrct", false) != null)
     {
         message.SendReadReceipt();
         this.Infobar.AddMessageLocalized(641302712, InfobarMessageType.Informational);
         return;
     }
     if (!this.IsEmbeddedItem)
     {
         InfobarMessageBuilder.AddSendReceiptNotice(base.UserContext, this.Infobar, message);
     }
 }
Exemplo n.º 10
0
 // Token: 0x060027E8 RID: 10216 RVA: 0x000E1E14 File Offset: 0x000E0014
 protected override void OnLoad(EventArgs e)
 {
     ExTraceGlobals.ContactsCallTracer.TraceDebug((long)this.GetHashCode(), "EditContact.OnLoad");
     base.OnLoad(e);
     this.contact            = base.Initialize <Contact>(false, EditContact.prefetchProperties);
     this.firstPhoneProperty = null;
     this.firstEmailProperty = null;
     if (this.contact != null)
     {
         for (int i = 0; i < ContactUtilities.PhoneNumberProperties.Length; i++)
         {
             ContactPropertyInfo contactPropertyInfo = ContactUtilities.PhoneNumberProperties[i];
             string propertyValue = this.GetPropertyValue(contactPropertyInfo.PropertyDefinition);
             if (this.firstPhoneProperty == null && !string.IsNullOrEmpty(propertyValue))
             {
                 this.firstPhoneProperty = contactPropertyInfo;
                 break;
             }
         }
         for (int j = 0; j < ContactUtilities.EmailAddressProperties.Length; j++)
         {
             ContactPropertyInfo contactPropertyInfo2 = ContactUtilities.EmailAddressProperties[j];
             string value  = null;
             string value2 = null;
             this.GetEmailAddressValue(contactPropertyInfo2, out value, out value2);
             this.GetPropertyValue(contactPropertyInfo2.PropertyDefinition);
             if (this.firstEmailProperty == null && (!string.IsNullOrEmpty(value) || !string.IsNullOrEmpty(value2)))
             {
                 this.firstEmailProperty = contactPropertyInfo2;
                 break;
             }
         }
         InfobarMessageBuilder.AddFlag(this.infobar, this.contact, base.UserContext);
     }
     if (this.firstPhoneProperty == null)
     {
         this.firstPhoneProperty = ContactUtilities.AssistantPhoneNumber;
     }
     if (this.firstEmailProperty == null)
     {
         this.firstEmailProperty = ContactUtilities.Email1EmailAddress;
     }
     this.isPhoneticNamesEnabled = Utilities.IsJapanese;
     this.toolbar             = new EditContactToolbar(this.contact);
     this.toolbar.ToolbarType = ToolbarType.View;
 }
Exemplo n.º 11
0
 public MeetingInviteWriter(MeetingRequest meetingRequest, UserContext userContext, string toolbarId, bool isPreviewForm, bool isInDeletedItems, bool isEmbeddedItem, bool isInJunkEmailFolder, bool isSuspectedPhishingItem, bool isLinkEnabled) : base(meetingRequest, userContext, isPreviewForm, isInDeletedItems, isEmbeddedItem, isInJunkEmailFolder, isSuspectedPhishingItem, isLinkEnabled)
 {
     this.meetingRequest = meetingRequest;
     this.isDelegated    = meetingRequest.IsDelegated();
     if (toolbarId == null)
     {
         toolbarId = "mpToolbar";
     }
     if (!Utilities.IsPublic(meetingRequest) && !this.IsDraft && !isEmbeddedItem)
     {
         this.isOrganizer = base.ProcessMeetingMessage(meetingRequest, Utilities.IsItemInDefaultFolder(meetingRequest, DefaultFolderType.Inbox));
         if (this.isOrganizer)
         {
             this.AttendeeResponseWell = new CalendarItemAttendeeResponseRecipientWell(this.CalendarItemBase);
         }
     }
     this.meetingMessageType = meetingRequest.MeetingRequestType;
     if (!this.IsDraft)
     {
         if (this.meetingMessageType == MeetingMessageType.Outdated)
         {
             this.infobarResponseString = new Strings.IDs?(1771878760);
             this.meetingMessageType    = MeetingMessageType.Outdated;
         }
         else if (this.isOrganizer)
         {
             this.infobarResponseString = new Strings.IDs?(247559721);
             this.meetingMessageType    = MeetingMessageType.InformationalUpdate;
         }
         else if (this.meetingMessageType == MeetingMessageType.InformationalUpdate)
         {
             if (this.CalendarItemBase != null && this.CalendarItemBase.ResponseType != ResponseType.NotResponded)
             {
                 this.infobarResponseString = new Strings.IDs?(689325109);
             }
             else
             {
                 this.meetingMessageType = MeetingMessageType.FullUpdate;
             }
         }
     }
     InfobarMessageBuilder.AddFlag(this.FormInfobar, meetingRequest, userContext);
     this.meetingRequestRecipientWell = new MeetingRequestRecipientWell(meetingRequest);
     this.toolbar             = new EditMeetingInviteToolbar(toolbarId, meetingRequest.IsResponseRequested, Utilities.IsInArchiveMailbox(meetingRequest), this.meetingMessageType);
     this.toolbar.ToolbarType = ToolbarType.Preview;
 }
Exemplo n.º 12
0
        // Token: 0x060005FE RID: 1534 RVA: 0x000300A8 File Offset: 0x0002E2A8
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            if (ObjectClass.IsMessage(base.OwaContext.FormsRegistryContext.Type, false))
            {
                this.message = base.Initialize <MessageItem>(ReadMessage.prefetchProperties);
            }
            else
            {
                this.message = base.InitializeAsMessageItem(ReadMessage.prefetchProperties);
            }
            this.recipientWell = new MessageRecipientWell(base.UserContext, this.message);
            RenderingUtilities.RenderReplyForwardMessageStatus(this.message, base.Infobar, base.UserContext);
            object obj = this.message.TryGetProperty(MessageItemSchema.IsDraft);

            if (obj is bool && (bool)obj)
            {
                base.Infobar.AddMessageLocalized(-1981719796, InfobarMessageType.Informational);
            }
            else
            {
                InfobarMessageBuilder.AddImportance(base.Infobar, this.message);
                InfobarMessageBuilder.AddSensitivity(base.Infobar, this.message);
                InfobarMessageBuilder.AddCompliance(base.UserContext, base.Infobar, this.message, false);
                if (Utilities.IsClearSigned(this.message) || Utilities.IsOpaqueSigned(this.message))
                {
                    base.Infobar.AddMessageLocalized(-1329088272, InfobarMessageType.Warning);
                }
                else if (Utilities.IsEncrypted(this.message))
                {
                    base.Infobar.AddMessageLocalized(-767943720, InfobarMessageType.Warning);
                }
            }
            InfobarMessageBuilder.AddFlag(base.Infobar, this.message, base.UserContext);
            if (this.message.Id != null && !this.message.IsRead)
            {
                this.message.MarkAsRead(Utilities.ShouldSuppressReadReceipt(base.UserContext, this.message), false);
            }
            this.isJunk = false;
            if (!this.isEmbeddedItem)
            {
                this.isJunk = Utilities.IsDefaultFolderId(base.Item.Session, this.CurrentFolderId, DefaultFolderType.JunkEmail);
            }
            base.HandleReadReceipt(this.message);
        }
Exemplo n.º 13
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.post = base.Initialize <PostItem>(ReadPost.prefetchProperties);
            if (!base.IsPreviewForm && !base.IsEmbeddedItem)
            {
                this.post.MarkAsRead(false);
            }
            bool flag  = false;
            bool flag2 = false;
            bool flag3 = false;

            JunkEmailUtilities.GetJunkEmailPropertiesForItem(this.post, base.IsEmbeddedItem, base.ForceEnableItemLink, base.UserContext, out this.isInJunkmailFolder, out flag, out flag2, out flag3);
            this.isSuspectedPhishingItemWithoutLinkEnabled = (flag && !flag2);
            this.toolbar = new ReadPostToolbar(base.IsEmbeddedItem, base.Item);
            InfobarMessageBuilder.AddImportance(this.infobar, this.post);
            InfobarMessageBuilder.AddSensitivity(this.infobar, this.post);
            InfobarMessageBuilder.AddFlag(this.infobar, this.post, base.UserContext);
            InfobarMessageBuilder.AddCompliance(base.UserContext, this.infobar, this.post, false);
        }
Exemplo n.º 14
0
 // Token: 0x06002ADF RID: 10975 RVA: 0x000F1888 File Offset: 0x000EFA88
 protected virtual void AddMessagesToInfobar()
 {
     InfobarMessageBuilder.AddImportance(this.infobar, this.Message);
     InfobarMessageBuilder.AddSensitivity(this.infobar, this.Message);
     InfobarMessageBuilder.AddFlag(this.infobar, this.Message, base.UserContext);
     InfobarMessageBuilder.AddCompliance(base.UserContext, this.infobar, this.Message, false);
     InfobarMessageBuilder.AddDeletePolicyInformation(this.infobar, this.Message, base.UserContext);
     this.AddIrmMessageToInfobar();
     if (!base.IsEmbeddedItem && !this.IsPublicItem)
     {
         InfobarMessageBuilder.AddReadReceiptNotice(base.UserContext, this.infobar, this.Message);
     }
     if (ObjectClass.IsTaskRequest(this.Message.ClassName))
     {
         this.infobar.AddMessage(SanitizedHtmlString.FromStringId(357315796), InfobarMessageType.Informational);
     }
     if (TextMessagingUtilities.NeedToAddUnsyncedMessageInfobar(this.Message.ClassName, this.Message, base.UserContext.MailboxSession))
     {
         this.infobar.AddMessage(SanitizedHtmlString.FromStringId(882347163), InfobarMessageType.Informational);
     }
 }
Exemplo n.º 15
0
        public void FlagItem()
        {
            FlagAction flagAction = (FlagAction)base.GetParameter("flga");
            ExDateTime?dueDate    = null;

            if (flagAction == FlagAction.SpecificDate)
            {
                if (!base.IsParameterSet("ddt"))
                {
                    throw new OwaInvalidRequestException("Due date must be provided if specifying a specific due date");
                }
                dueDate = new ExDateTime?((ExDateTime)base.GetParameter("ddt"));
            }
            using (Item item = this.GetItem())
            {
                MessageItem messageItem = item as MessageItem;
                if (messageItem != null && messageItem.IsDraft)
                {
                    throw new OwaOperationNotSupportedException(LocalizedStrings.GetNonEncoded(804173896));
                }
                switch (flagAction)
                {
                case FlagAction.MarkComplete:
                    FlagEventHandler.FlagComplete(item);
                    break;

                case FlagAction.ClearFlag:
                    FlagEventHandler.ClearFlag(item);
                    break;

                default:
                    dueDate = FlagEventHandler.SetFlag(item, flagAction, dueDate);
                    break;
                }
                Utilities.SaveItem(item);
                PropertyDefinition[] properties = new PropertyDefinition[]
                {
                    ItemSchema.FlagStatus,
                    ItemSchema.FlagCompleteTime,
                    MessageItemSchema.ReplyTime
                };
                item.Load(properties);
                InfobarMessage flag = InfobarMessageBuilder.GetFlag(item, base.UserContext);
                this.Writer.Write("var sIBMsg = \"");
                if (flag != null)
                {
                    StringBuilder stringBuilder = new StringBuilder();
                    StringWriter  stringWriter  = new StringWriter(stringBuilder);
                    Infobar.RenderMessage(stringWriter, flag, base.UserContext);
                    stringWriter.Close();
                    Utilities.JavascriptEncode(stringBuilder.ToString(), this.Writer);
                }
                this.Writer.Write("\";");
                this.Writer.Write("a_sId = \"");
                Utilities.JavascriptEncode(Utilities.GetIdAsString(item), this.Writer);
                this.Writer.Write("\";");
                this.Writer.Write("a_sCK = \"");
                Utilities.JavascriptEncode(item.Id.ChangeKeyAsBase64String(), this.Writer);
                this.Writer.Write("\";");
                this.Writer.Write("var dtDD = ");
                if (dueDate != null)
                {
                    this.Writer.Write("new Date(\"");
                    this.Writer.Write(DateTimeUtilities.GetJavascriptDate(dueDate.Value));
                    this.Writer.Write("\");");
                }
                else
                {
                    this.Writer.Write("0;");
                }
            }
        }
Exemplo n.º 16
0
        // Token: 0x06002FD0 RID: 12240 RVA: 0x00116600 File Offset: 0x00114800
        public static void AddCalendarInfobarMessages(Infobar infobar, CalendarItemBase calendarItemBase, MeetingMessage meetingMessage, UserContext userContext)
        {
            if (infobar == null)
            {
                throw new ArgumentNullException("infobar");
            }
            if (calendarItemBase == null)
            {
                throw new ArgumentNullException("calendarItemBase");
            }
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            bool       flag      = calendarItemBase.IsOrganizer() && calendarItemBase.IsMeeting;
            ExDateTime localTime = DateTimeUtilities.GetLocalTime();
            bool       flag2     = false;

            if (calendarItemBase.IsMeeting && calendarItemBase.IsCancelled)
            {
                infobar.AddMessage(-161808760, InfobarMessageType.Informational);
            }
            if (calendarItemBase.CalendarItemType == CalendarItemType.RecurringMaster)
            {
                CalendarItem calendarItem = (CalendarItem)calendarItemBase;
                if (calendarItem.Recurrence != null && !(calendarItem.Recurrence.Range is NoEndRecurrenceRange))
                {
                    OccurrenceInfo lastOccurrence = calendarItem.Recurrence.GetLastOccurrence();
                    if (lastOccurrence != null && lastOccurrence.EndTime < localTime)
                    {
                        infobar.AddMessage(-2124392108, InfobarMessageType.Informational);
                        flag2 = true;
                    }
                }
            }
            else if (calendarItemBase.EndTime < localTime)
            {
                flag2 = true;
                if (calendarItemBase.CalendarItemType != CalendarItemType.RecurringMaster)
                {
                    infobar.AddMessage(-593429293, InfobarMessageType.Informational);
                }
            }
            InfobarMessageBuilder.AddFlag(infobar, calendarItemBase, userContext);
            if (flag)
            {
                if (calendarItemBase.MeetingRequestWasSent)
                {
                    CalendarUtilities.AddAttendeeResponseCountMessage(infobar, calendarItemBase);
                }
                else
                {
                    infobar.AddMessage(613373695, InfobarMessageType.Informational);
                }
            }
            if (!calendarItemBase.IsOrganizer() && calendarItemBase.IsMeeting)
            {
                bool           flag3          = false;
                MeetingRequest meetingRequest = meetingMessage as MeetingRequest;
                if (meetingRequest != null)
                {
                    flag3 = (meetingRequest.MeetingRequestType == MeetingMessageType.PrincipalWantsCopy);
                }
                if (calendarItemBase.ResponseType != ResponseType.NotResponded)
                {
                    Strings.IDs?ds  = null;
                    Strings.IDs?ds2 = null;
                    switch (calendarItemBase.ResponseType)
                    {
                    case ResponseType.Tentative:
                        ds  = new Strings.IDs?(-1859761232);
                        ds2 = new Strings.IDs?(1365345389);
                        break;

                    case ResponseType.Accept:
                        ds  = new Strings.IDs?(-700793833);
                        ds2 = new Strings.IDs?(-1153967082);
                        break;

                    case ResponseType.Decline:
                        ds  = new Strings.IDs?(-278420592);
                        ds2 = new Strings.IDs?(2009978813);
                        break;
                    }
                    if (ds != null)
                    {
                        ExDateTime property = ItemUtility.GetProperty <ExDateTime>(calendarItemBase, CalendarItemBaseSchema.AppointmentReplyTime, ExDateTime.MinValue);
                        string     text     = Strings.None;
                        string     text2    = string.Empty;
                        if (property != ExDateTime.MinValue)
                        {
                            text  = property.ToString(userContext.UserOptions.DateFormat);
                            text2 = property.ToString(userContext.UserOptions.TimeFormat);
                        }
                        string property2 = ItemUtility.GetProperty <string>(calendarItemBase, CalendarItemBaseSchema.AppointmentReplyName, string.Empty);
                        SanitizedHtmlString messageHtml;
                        if (string.Compare(property2, userContext.ExchangePrincipal.MailboxInfo.DisplayName, StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            messageHtml = SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(ds.Value), new object[]
                            {
                                text,
                                text2
                            });
                        }
                        else
                        {
                            messageHtml = SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(ds2.Value), new object[]
                            {
                                property2,
                                text,
                                text2
                            });
                        }
                        infobar.AddMessage(messageHtml, InfobarMessageType.Informational);
                        return;
                    }
                }
                else if (!flag2 && !calendarItemBase.IsCancelled)
                {
                    if (!flag3)
                    {
                        bool property3 = ItemUtility.GetProperty <bool>(calendarItemBase, ItemSchema.IsResponseRequested, true);
                        if (property3)
                        {
                            infobar.AddMessage(919273049, InfobarMessageType.Informational);
                        }
                        else
                        {
                            infobar.AddMessage(1602295502, InfobarMessageType.Informational);
                        }
                    }
                    else
                    {
                        infobar.AddMessage(-200304859, InfobarMessageType.Informational);
                    }
                    CalendarUtilities.GetConflictingAppointments(infobar, calendarItemBase, userContext);
                }
            }
        }
Exemplo n.º 17
0
 public void SetDateAndReminder()
 {
     using (Item item = this.GetItem())
     {
         MessageItem messageItem = item as MessageItem;
         if (messageItem != null && messageItem.IsDraft)
         {
             this.Writer.Write("var iError = 1;");
             this.Writer.Write("alrt(\"");
             this.Writer.Write(LocalizedStrings.GetJavascriptEncoded(-1537113578));
             this.Writer.Write("\", null, Owa.BUTTON_DIALOG_ICON.WARNING, L_Wrng);");
         }
         else
         {
             this.Writer.Write("var iError = 0;");
             ExDateTime?exDateTime  = null;
             ExDateTime?exDateTime2 = null;
             ExDateTime?dueBy       = null;
             if (base.IsParameterSet("sdt"))
             {
                 exDateTime = new ExDateTime?((ExDateTime)base.GetParameter("sdt"));
             }
             if (base.IsParameterSet("ddt"))
             {
                 exDateTime2 = new ExDateTime?((ExDateTime)base.GetParameter("ddt"));
             }
             if (base.IsParameterSet("rem"))
             {
                 dueBy = new ExDateTime?((ExDateTime)base.GetParameter("rem"));
             }
             if (exDateTime != null && exDateTime2 == null)
             {
                 throw new OwaInvalidRequestException("A due date must be provided if a start date is specified");
             }
             if (exDateTime != null && exDateTime2 != null && exDateTime2 < exDateTime)
             {
                 throw new OwaInvalidRequestException("The due date must be on or after the start date");
             }
             Task task = item as Task;
             if (task != null)
             {
                 task.StartDate = exDateTime;
                 task.DueDate   = exDateTime2;
                 task.SetStatusInProgress();
             }
             else
             {
                 item.SetFlag(LocalizedStrings.GetNonEncoded(-1950847676), exDateTime, exDateTime2);
             }
             if (item.Reminder != null)
             {
                 if (dueBy != null)
                 {
                     item.Reminder.IsSet = true;
                     item.Reminder.DueBy = dueBy;
                 }
                 else
                 {
                     item.Reminder.IsSet = false;
                 }
             }
             Utilities.SaveItem(item);
             item.Load(new PropertyDefinition[]
             {
                 ItemSchema.FlagStatus,
                 ItemSchema.FlagCompleteTime
             });
             this.Writer.Write("var iFA = ");
             this.Writer.Write((int)FlagContextMenu.GetFlagActionForItem(base.UserContext, item));
             this.Writer.Write(";");
             InfobarMessage flag = InfobarMessageBuilder.GetFlag(item, base.UserContext);
             this.Writer.Write("var sIBMsg = \"");
             if (flag != null)
             {
                 StringBuilder stringBuilder = new StringBuilder();
                 StringWriter  stringWriter  = new StringWriter(stringBuilder);
                 Infobar.RenderMessage(stringWriter, flag, base.UserContext);
                 stringWriter.Close();
                 Utilities.JavascriptEncode(stringBuilder.ToString(), this.Writer);
             }
             this.Writer.Write("\";");
             OwaStoreObjectId owaStoreObjectId = base.GetParameter("id") as OwaStoreObjectId;
             this.Writer.Write("sId = \"");
             Utilities.JavascriptEncode((owaStoreObjectId == null) ? Utilities.GetIdAsString(item) : owaStoreObjectId.ToBase64String(), this.Writer);
             this.Writer.Write("\";");
             this.Writer.Write("sCK = \"");
             if (owaStoreObjectId == null || !owaStoreObjectId.IsConversationId)
             {
                 Utilities.JavascriptEncode(item.Id.ChangeKeyAsBase64String(), this.Writer);
             }
             this.Writer.Write("\";");
             this.Writer.Write("var dtDD = ");
             if (exDateTime2 != null)
             {
                 this.Writer.Write("new Date(\"");
                 this.Writer.Write(DateTimeUtilities.GetJavascriptDate(exDateTime2.Value));
                 this.Writer.Write("\");");
             }
             else
             {
                 this.Writer.Write("0;");
             }
         }
     }
 }
Exemplo n.º 18
0
        protected internal override void BuildInfobar()
        {
            InfobarMessageBuilder.AddFlag(this.FormInfobar, this.meetingResponse, this.UserContext);
            if (this.isDraft)
            {
                this.FormInfobar.AddMessage(-1981719796, InfobarMessageType.Informational);
                string format = string.Empty;
                switch (this.meetingResponse.ResponseType)
                {
                case ResponseType.Tentative:
                    format = LocalizedStrings.GetHtmlEncoded(-588720585);
                    break;

                case ResponseType.Accept:
                    format = LocalizedStrings.GetHtmlEncoded(-14610226);
                    break;

                case ResponseType.Decline:
                    format = LocalizedStrings.GetHtmlEncoded(-1615218790);
                    break;
                }
                SanitizedHtmlString messageHtml;
                if (this.meetingResponse.From != null && string.CompareOrdinal(this.UserContext.ExchangePrincipal.LegacyDn, this.meetingResponse.From.EmailAddress) != 0)
                {
                    ADSessionSettings adSettings  = Utilities.CreateScopedADSessionSettings(this.UserContext.LogonIdentity.DomainName);
                    string            displayName = ExchangePrincipal.FromLegacyDN(adSettings, this.meetingResponse.From.EmailAddress).MailboxInfo.DisplayName;
                    messageHtml = SanitizedHtmlString.Format(format, new object[]
                    {
                        displayName
                    });
                }
                else
                {
                    messageHtml = SanitizedHtmlString.Format(format, new object[]
                    {
                        LocalizedStrings.GetNonEncoded(372029413)
                    });
                }
                this.FormInfobar.AddMessage(messageHtml, InfobarMessageType.Informational);
                return;
            }
            string s   = string.Empty;
            string arg = string.Empty;

            if (this.OriginalSender == null || string.IsNullOrEmpty(this.OriginalSender.DisplayName))
            {
                arg = LocalizedStrings.GetNonEncoded(-342979842);
            }
            else
            {
                arg = this.OriginalSender.DisplayName;
            }
            switch (this.meetingResponse.ResponseType)
            {
            case ResponseType.Tentative:
                s = string.Format(Strings.InfoAttendeeTentative, arg);
                break;

            case ResponseType.Accept:
                s = string.Format(Strings.InfoAttendeeAccepted, arg);
                break;

            case ResponseType.Decline:
                s = string.Format(Strings.InfoAttendeeDecline, arg);
                break;
            }
            this.FormInfobar.AddMessage(Utilities.SanitizeHtmlEncode(s), InfobarMessageType.Informational);
            InfobarMessageBuilder.AddImportance(this.FormInfobar, this.meetingResponse);
            InfobarMessageBuilder.AddSensitivity(this.FormInfobar, this.meetingResponse);
            if (this.isDelegated)
            {
                this.FormInfobar.AddMessage(Utilities.SanitizeHtmlEncode(string.Format(LocalizedStrings.GetNonEncoded(-1205864060), MeetingUtilities.GetReceivedOnBehalfOfDisplayName(this.meetingResponse))), InfobarMessageType.Informational);
            }
            if (!this.isEmbeddedItem && !Utilities.IsPublic(this.meetingResponse))
            {
                InfobarMessageBuilder.AddReadReceiptNotice(this.UserContext, this.FormInfobar, this.meetingResponse);
            }
        }
Exemplo n.º 19
0
 protected override void OnLoad(EventArgs e)
 {
     base.OnLoad(e);
     if (this.IsPageCacheable)
     {
         Utilities.MakePageCacheable(base.Response);
     }
     else
     {
         Utilities.MakePageNoCacheNoStore(base.Response);
     }
     this.InitializeMessage();
     if (this.PageSupportSmime && this.message != null && Utilities.IsSMime(this.message))
     {
         if (!Utilities.IsSMimeFeatureUsable(base.OwaContext))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-1507367759));
         }
         if (Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 1))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-872682934));
         }
         if (Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 2))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-1103993212));
         }
         if (!Utilities.CheckSMimeEditFormBasicRequirement(base.ClientSMimeControlStatus, base.OwaContext))
         {
             throw new OwaNeedsSMimeControlToEditDraftException(LocalizedStrings.GetNonEncoded(-1507367759));
         }
     }
     if (!base.UserContext.IsIrmEnabled && this.message != null && Utilities.IsIrmRestricted(this.message))
     {
         SanitizedHtmlString sanitizedHtmlString = SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(1049269714), new object[]
         {
             Utilities.GetOfficeDownloadAnchor(Microsoft.Exchange.Data.Storage.BodyFormat.TextPlain, base.UserContext.UserCulture)
         });
         throw new OwaCannotEditIrmDraftException(sanitizedHtmlString.ToString());
     }
     if (this.message != null)
     {
         string action = base.OwaContext.FormsRegistryContext.Action;
         string state  = base.OwaContext.FormsRegistryContext.State;
         if (string.CompareOrdinal(action, "Reply") == 0 || string.CompareOrdinal(action, "ReplyAll") == 0)
         {
             this.newItemType = NewItemType.Reply;
         }
         else if (string.CompareOrdinal(action, "Forward") == 0)
         {
             this.newItemType = NewItemType.Forward;
         }
         else if (string.Equals(action, "Open", StringComparison.OrdinalIgnoreCase) && string.Equals(state, "Draft", StringComparison.OrdinalIgnoreCase))
         {
             this.newItemType = NewItemType.ExplicitDraft;
             if (this.message.GetValueOrDefault <bool>(MessageItemSchema.HasBeenSubmitted))
             {
                 this.message.AbortSubmit();
             }
         }
         else
         {
             this.newItemType         = NewItemType.ImplicitDraft;
             base.DeleteExistingDraft = true;
         }
     }
     else
     {
         this.CreateDraftMessage();
     }
     if (this.message != null && Utilities.IsPublic(this.message))
     {
         throw new OwaInvalidRequestException("No way to open a public message in edit form");
     }
     if (this.IsSMimeControlNeeded && this.PageSupportSmime)
     {
         this.bodyMarkup = Markup.Html;
     }
     else
     {
         this.bodyMarkup = BodyConversionUtilities.GetBodyFormatOfEditItem(base.Item, this.newItemType, base.UserContext.UserOptions);
     }
     this.SetIsOtherFolder();
     this.infobar.SetInfobarClass("infobarEdit");
     this.infobar.SetShouldHonorHideByDefault(true);
     if (this.newItemType != NewItemType.New)
     {
         if (this.newItemType == NewItemType.ExplicitDraft)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-1981719796), InfobarMessageType.Informational);
         }
         InfobarMessageBuilder.AddSensitivity(this.infobar, this.message);
         if (this.newItemType != NewItemType.ImplicitDraft)
         {
             InfobarMessageBuilder.AddCompliance(base.UserContext, this.infobar, this.message, true);
         }
         if (base.UserContext.IsIrmEnabled && this.message != null)
         {
             InfobarMessageBuilder.AddIrmInformation(this.infobar, this.message, false, true, false, this.IsIrmAsAttachment);
         }
         this.recipientWell       = new MessageRecipientWell(this.message);
         this.showBcc             = (this.recipientWell.HasRecipients(RecipientWellType.Bcc) || base.UserContext.UserOptions.AlwaysShowBcc);
         this.showFrom            = (this.recipientWell.HasRecipients(RecipientWellType.From) || base.UserContext.UserOptions.AlwaysShowFrom || this.isOtherFolder);
         this.toolbar             = this.BuildToolbar();
         this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
         this.addSignatureToBody  = base.ShouldAddSignatureToBody(this.bodyMarkup, this.newItemType);
     }
     else
     {
         this.recipientWell       = new MessageRecipientWell();
         this.showBcc             = base.UserContext.UserOptions.AlwaysShowBcc;
         this.showFrom            = (base.UserContext.UserOptions.AlwaysShowFrom || this.isOtherFolder);
         this.toolbar             = new EditMessageToolbar(Importance.Normal, this.bodyMarkup, this.IsSMimeControlMustUpdate, this.IsSMimeControlNeeded, false, false);
         this.toolbar.ToolbarType = (base.IsPreviewForm ? ToolbarType.Preview : ToolbarType.Form);
     }
     if (base.OwaContext.UserContext.IsFeatureEnabled(Feature.SMime) && this.PageSupportSmime)
     {
         if (this.IsSMimeControlNeeded && Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 4))
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(330022834), InfobarMessageType.Informational);
         }
         else if (this.IsSMimeControlMustUpdate)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(1697878138), InfobarMessageType.Informational);
         }
         if (Utilities.IsSMimeControlNeededForEditForm(base.ClientSMimeControlStatus, base.OwaContext) && this.ShowFrom)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-1863471683), InfobarMessageType.Informational);
         }
         if (!Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 1) && !Utilities.IsFlagSet((int)base.ClientSMimeControlStatus, 16) && !base.OwaContext.UserContext.IsExplicitLogonOthersMailbox)
         {
             this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-1908761042), InfobarMessageType.Warning);
         }
     }
     if (this.Message != null && this.IsRemoveRestricted)
     {
         this.toolbar.IsComplianceButtonEnabledInForm = false;
     }
     if (this.ShowFrom && this.IsFromWellRestricted)
     {
         this.infobar.AddMessage(SanitizedHtmlString.FromStringId(885106754), InfobarMessageType.Informational);
     }
     if (this.message != null && this.newItemType == NewItemType.ExplicitDraft && Utilities.IsInArchiveMailbox(base.Item))
     {
         this.toolbar.IsSendButtonEnabledInForm = false;
     }
 }