Esempio n. 1
0
        private static void InternalGetFolderViewStates(UserContext userContext, CalendarFolder folder, ref ExDateTime[] days, ref CalendarViewType viewType, out int viewWidth, out ReadingPanePosition readingPanePosition)
        {
            FolderViewStates folderViewStates = userContext.GetFolderViewStates(folder);

            CalendarUtilities.GetCalendarViewParamsFromViewStates(folderViewStates, out viewWidth, ref viewType, out readingPanePosition);
            days = CalendarUtilities.GetViewDays(userContext, days, viewType, OwaStoreObjectId.CreateFromStoreObject(folder), folderViewStates);
        }
Esempio n. 2
0
        // Token: 0x0600258F RID: 9615 RVA: 0x000D943C File Offset: 0x000D763C
        internal SharedCalendarItemInfobar(UserContext userContext, CalendarFolder folder, int colorIndex, bool renderNotifyForOtherUser)
        {
            if (userContext == null)
            {
                throw new ArgumentNullException("userContext");
            }
            if (folder == null)
            {
                throw new ArgumentNullException("folder");
            }
            this.userContext = userContext;
            this.folder      = folder;
            this.colorIndex  = colorIndex;
            this.renderNotifyForOtherUser = renderNotifyForOtherUser;
            this.isSharedOutFolder        = Utilities.IsFolderSharedOut(folder);
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromStoreObject(folder);

            if (owaStoreObjectId.GetSession(userContext) is MailboxSession)
            {
                this.folderEncodedDisplayName = Utilities.SanitizeHtmlEncode(string.Format(LocalizedStrings.GetNonEncoded(-83764036), folder.DisplayName, Utilities.GetMailboxOwnerDisplayName((MailboxSession)owaStoreObjectId.GetSession(userContext))));
            }
            else
            {
                this.folderEncodedDisplayName = Utilities.SanitizeHtmlEncode(folder.DisplayName);
            }
            this.isSharedFolder = (owaStoreObjectId != null && owaStoreObjectId.IsOtherMailbox);
            this.isPublicFolder = owaStoreObjectId.IsPublic;
            if (this.isSharedFolder)
            {
                this.folderOwnerEncodedName = Utilities.SanitizeHtmlEncode(Utilities.GetFolderOwnerExchangePrincipal(owaStoreObjectId, userContext).MailboxInfo.DisplayName);
            }
            this.containerClass = folder.GetValueOrDefault <string>(StoreObjectSchema.ContainerClass, "IPF.Appointment");
        }
        public void EditResponseCalendarItem()
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingInviteEventHandler.EditResponseCalendarItem");
            ResponseType     responseType     = (ResponseType)base.GetParameter("Rsp");
            CalendarItemBase calendarItemBase = null;

            try
            {
                calendarItemBase = base.GetRequestItem <CalendarItemBase>(new PropertyDefinition[0]);
                if (calendarItemBase != null)
                {
                    this.EditResponseInternal(responseType, calendarItemBase);
                    calendarItemBase.Load();
                    this.Writer.Write("<div id=nid>");
                    if (calendarItemBase.Id != null && calendarItemBase.Id.ObjectId != null)
                    {
                        this.Writer.Write(OwaStoreObjectId.CreateFromStoreObject(calendarItemBase).ToBase64String());
                    }
                    this.Writer.Write("</div>");
                }
            }
            finally
            {
                if (calendarItemBase != null)
                {
                    calendarItemBase.Dispose();
                    calendarItemBase = null;
                }
            }
        }
Esempio n. 4
0
 protected void RenderJavascriptEncodedCalendarItemBaseMasterId()
 {
     if (this.calendarItemBase != null && (this.calendarItemBase.CalendarItemType == CalendarItemType.Occurrence || this.calendarItemBase.CalendarItemType == CalendarItemType.Exception))
     {
         OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromStoreObject(this.calendarItemBase);
         Utilities.JavascriptEncode(owaStoreObjectId.ProviderLevelItemId.ToString(), base.SanitizingResponse);
     }
 }
Esempio n. 5
0
        // Token: 0x06002926 RID: 10534 RVA: 0x000E9020 File Offset: 0x000E7220
        protected void RenderJavascriptEncodedCalendarItemBaseMasterId()
        {
            CalendarItemBase calendarItemBase = this.meetingPageWriter.CalendarItemBase;

            if (this.isCalendarItem && !base.IsEmbeddedItem && !base.IsInDeleteItems && (calendarItemBase.CalendarItemType == CalendarItemType.Occurrence || calendarItemBase.CalendarItemType == CalendarItemType.Exception))
            {
                OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromStoreObject(calendarItemBase);
                Utilities.JavascriptEncode(owaStoreObjectId.ProviderLevelItemId.ToString(), base.Response.Output);
            }
        }
Esempio n. 6
0
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.Item;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
            Item item  = null;
            Item item2 = null;
            Item item3 = null;

            try
            {
                HttpContext httpContext          = owaContext.HttpContext;
                UserContext userContext          = owaContext.UserContext;
                string      queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "fId", true);
                item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2);
                BodyFormat replyForwardBodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext);
                item3 = ReplyForwardUtilities.CreatePostReplyItem(replyForwardBodyFormat, item as PostItem, userContext, Utilities.GetParentFolderId(item2, item));
                item3.Save(SaveMode.ResolveConflicts);
                item3.Load();
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type   = "IPM.Post";
                preFormActionResponse.Action = "PostReply";
                preFormActionResponse.AddParameter("Id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String());
                preFormActionResponse.AddParameter("fId", queryStringParameter);
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
                if (item3 != null)
                {
                    item3.Dispose();
                    item3 = null;
                }
            }
            return(preFormActionResponse);
        }
Esempio n. 7
0
 public CalendarDataSource(UserContext userContext, CalendarFolder folder, DateRange[] dateRanges, PropertyDefinition[] properties) : base(dateRanges, properties)
 {
     if (userContext == null)
     {
         throw new ArgumentNullException("userContext");
     }
     if (folder == null)
     {
         throw new ArgumentNullException("folder");
     }
     this.userContext = userContext;
     this.folder      = folder;
     this.folderId    = OwaStoreObjectId.CreateFromStoreObject(folder);
     base.Load((ExDateTime start, ExDateTime end) => folder.GetCalendarView(start, end, properties));
 }
Esempio n. 8
0
 public CalendarAdapter(UserContext userContext, CalendarFolder folder)
 {
     this.ownFolder = true;
     base..ctor();
     if (userContext == null)
     {
         throw new ArgumentNullException("userContext");
     }
     if (folder == null)
     {
         throw new ArgumentNullException("folder");
     }
     this.UserContext = userContext;
     this.folder      = folder;
     this.FolderId    = OwaStoreObjectId.CreateFromStoreObject(folder);
     this.ownFolder   = false;
 }
 // Token: 0x06002DBB RID: 11707 RVA: 0x001030F8 File Offset: 0x001012F8
 private void EditResponseInternal(ResponseType responseType, CalendarItemBase calendarItemBase, bool doCalendarItemUpdate)
 {
     ExTraceGlobals.CalendarCallTracer.TraceDebug((long)this.GetHashCode(), "EditMeetingInviteEventHandler.EditResponseInternal");
     MeetingUtilities.ThrowIfMeetingResponseInvalid(calendarItemBase);
     if (doCalendarItemUpdate)
     {
         this.UpdateItem(calendarItemBase);
         Utilities.SaveItem(calendarItemBase);
         calendarItemBase.Load();
     }
     using (MeetingResponse meetingResponse = MeetingUtilities.EditResponse(responseType, calendarItemBase))
     {
         meetingResponse.Load();
         this.Writer.Write("<div id=divOp _sOp=mr>");
         this.Writer.Write(OwaStoreObjectId.CreateFromStoreObject(meetingResponse).ToBase64String());
         this.Writer.Write("</div>");
     }
 }
Esempio n. 10
0
        private void LoadFolderViewStates(CalendarFolder advicedFolder, ref ExDateTime[] days, ref CalendarViewType viewType, out int viewWidth, out ReadingPanePosition readingPanePosition)
        {
            OwaStoreObjectId owaStoreObjectId = null;

            if (advicedFolder != null)
            {
                owaStoreObjectId = OwaStoreObjectId.CreateFromStoreObject(advicedFolder);
            }
            if (owaStoreObjectId != null && (owaStoreObjectId.Equals(this.UserContext.CalendarFolderOwaId) || owaStoreObjectId.IsPublic))
            {
                CalendarAdapter.InternalGetFolderViewStates(this.UserContext, advicedFolder, ref days, ref viewType, out viewWidth, out readingPanePosition);
                return;
            }
            using (CalendarFolder folderForContent = Utilities.GetFolderForContent <CalendarFolder>(this.UserContext, this.UserContext.CalendarFolderOwaId, CalendarUtilities.FolderViewProperties))
            {
                CalendarAdapter.InternalGetFolderViewStates(this.UserContext, folderForContent, ref days, ref viewType, out viewWidth, out readingPanePosition);
            }
        }
Esempio n. 11
0
        protected void MoveItemToDestinationFolderIfInScratchPad(Item item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }
            OwaStoreObjectId owaStoreObjectId = base.GetParameter("fId") as OwaStoreObjectId;

            if (owaStoreObjectId == null)
            {
                return;
            }
            if (!owaStoreObjectId.IsPublic)
            {
                return;
            }
            item.Load();
            if (item.ParentId.Equals(owaStoreObjectId.StoreObjectId))
            {
                return;
            }
            OwaStoreObjectId owaStoreObjectId2 = OwaStoreObjectId.CreateFromStoreObject(item);
            OperationResult  operationResult   = Utilities.CopyOrMoveItems(base.UserContext, false, owaStoreObjectId, new OwaStoreObjectId[]
            {
                owaStoreObjectId2
            }).OperationResult;

            if (operationResult == OperationResult.Succeeded)
            {
                this.Writer.Write("<div id=divFC>");
                this.Writer.Write(LocalizedStrings.GetHtmlEncoded(-1580283653));
                this.Writer.Write("</div>");
                return;
            }
            this.SaveIdAndChangeKeyInCustomErrorInfo(item);
            throw new OwaEventHandlerException("Could not move the item out from scratch pad into target folder", LocalizedStrings.GetNonEncoded(1665365872), true);
        }
Esempio n. 12
0
 private void RenderSharingResponseMessageId(SharingMessageItem responseItem)
 {
     this.SanitizingWriter.Write("<div id=divOp _sOp=mr>");
     this.SanitizingWriter.Write(OwaStoreObjectId.CreateFromStoreObject(responseItem).ToBase64String());
     this.SanitizingWriter.Write("</div>");
 }
Esempio n. 13
0
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            Item                  item       = null;
            Item                  item2      = null;
            Item                  item3      = null;
            bool                  flag       = false;
            BodyFormat            bodyFormat = BodyFormat.TextPlain;
            PreFormActionResponse result;

            try
            {
                HttpContext httpContext = owaContext.HttpContext;
                UserContext userContext = owaContext.UserContext;
                item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2);
                RightsManagedMessageDecryptionStatus decryptionStatus = RightsManagedMessageDecryptionStatus.FeatureDisabled;
                if (userContext.IsIrmEnabled)
                {
                    try
                    {
                        flag = Utilities.IrmDecryptForReplyForward(owaContext, ref item, ref item2, ref bodyFormat, out decryptionStatus);
                    }
                    catch (RightsManagementPermanentException exception)
                    {
                        decryptionStatus = RightsManagedMessageDecryptionStatus.CreateFromException(exception);
                    }
                }
                if (!flag)
                {
                    bodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext);
                }
                string            queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "smime", false);
                bool              flag2             = Utilities.IsSMimeControlNeededForEditForm(queryStringParameter, owaContext);
                bool              flag3             = userContext.IsSmsEnabled && ObjectClass.IsSmsMessage(owaContext.FormsRegistryContext.Type);
                bool              flag4             = ObjectClass.IsMeetingRequest(owaContext.FormsRegistryContext.Type);
                bool              flag5             = flag3 || (flag2 && Utilities.IsSMime(item)) || flag;
                ReplyForwardFlags replyForwardFlags = ReplyForwardFlags.None;
                if (flag5)
                {
                    replyForwardFlags |= ReplyForwardFlags.DropBody;
                }
                if (flag3 || flag)
                {
                    replyForwardFlags |= ReplyForwardFlags.DropHeader;
                }
                StoreObjectId parentFolderId = Utilities.GetParentFolderId(item2, item);
                item3 = ReplyForwardUtilities.CreateReplyAllItem(flag2 ? BodyFormat.TextHtml : bodyFormat, item, replyForwardFlags, userContext, parentFolderId);
                if (flag)
                {
                    using (ItemAttachment itemAttachment = item3.AttachmentCollection.AddExistingItem(item))
                    {
                        itemAttachment.Save();
                        goto IL_172;
                    }
                }
                if (Utilities.IsIrmRestrictedAndNotDecrypted(item))
                {
                    ReplyForwardUtilities.SetAlternateIrmBody(item3, flag2 ? BodyFormat.TextHtml : bodyFormat, userContext, parentFolderId, decryptionStatus, ObjectClass.IsVoiceMessage(item.ClassName));
                }
IL_172:
                type = "IPM.Note";
                if (flag3)
                {
                    item3.ClassName = "IPM.Note.Mobile.SMS";
                    type            = "IPM.Note.Mobile.SMS";
                    ReplyForwardUtilities.RemoveInvalidRecipientsFromSmsMessage((MessageItem)item3);
                }
                item3.Save(SaveMode.ResolveConflicts);
                item3.Load();
                PreFormActionResponse preFormActionResponse = new PreFormActionResponse(httpContext.Request, new string[]
                {
                    "cb",
                    "smime"
                });
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type   = type;
                preFormActionResponse.Action = "Reply";
                preFormActionResponse.AddParameter("id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String());
                if (flag5)
                {
                    preFormActionResponse.AddParameter("srcId", Utilities.GetItemIdQueryString(httpContext.Request));
                    if (Utilities.GetQueryStringParameter(httpContext.Request, "cb", false) == null && Utilities.IsWebBeaconsAllowed(item))
                    {
                        preFormActionResponse.AddParameter("cb", "1");
                    }
                }
                if (userContext.IsInOtherMailbox(item))
                {
                    preFormActionResponse.AddParameter("fOMF", "1");
                }
                if (item.GetValueOrDefault <bool>(MessageItemSchema.MessageBccMe) && !flag4)
                {
                    preFormActionResponse.AddParameter("fRABcc", "1");
                }
                if (flag)
                {
                    preFormActionResponse.AddParameter("fIrmAsAttach", "1");
                }
                result = preFormActionResponse;
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
                if (item3 != null)
                {
                    item3.Dispose();
                    item3 = null;
                }
            }
            return(result);
        }
Esempio n. 14
0
        // Token: 0x060022C1 RID: 8897 RVA: 0x000C69B8 File Offset: 0x000C4BB8
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            Item                  item       = null;
            Item                  item2      = null;
            Item                  item3      = null;
            bool                  flag       = false;
            BodyFormat            bodyFormat = BodyFormat.TextPlain;
            PreFormActionResponse result;

            try
            {
                HttpContext           httpContext           = owaContext.HttpContext;
                UserContext           userContext           = owaContext.UserContext;
                PreFormActionResponse preFormActionResponse = new PreFormActionResponse(httpContext.Request, new string[]
                {
                    "cb",
                    "smime"
                });
                item = ReplyForwardUtilities.GetItemForRequest(owaContext, out item2);
                if (item != null && !ItemUtility.IsForwardSupported(item))
                {
                    throw new OwaInvalidRequestException("Forwarding of such a type item is not supported.");
                }
                CalendarItemBase calendarItemBase = item as CalendarItemBase;
                if (item is Task || item is ContactBase || (calendarItemBase != null && !calendarItemBase.IsMeeting))
                {
                    item3 = ReplyForwardUtilities.CreateForwardMessageWithItemAttached(item, userContext);
                    preFormActionResponse.Action = "New";
                    preFormActionResponse.AddParameter("exdltdrft", "1");
                }
                else
                {
                    bool   flag2 = false;
                    string queryStringParameter = Utilities.GetQueryStringParameter(httpContext.Request, "smime", false);
                    RightsManagedMessageDecryptionStatus decryptionStatus = RightsManagedMessageDecryptionStatus.FeatureDisabled;
                    if (userContext.IsIrmEnabled)
                    {
                        try
                        {
                            flag = Utilities.IrmDecryptForReplyForward(owaContext, ref item, ref item2, ref bodyFormat, out decryptionStatus);
                        }
                        catch (RightsManagementPermanentException exception)
                        {
                            decryptionStatus = RightsManagedMessageDecryptionStatus.CreateFromException(exception);
                        }
                    }
                    if (!flag)
                    {
                        bodyFormat = ReplyForwardUtilities.GetReplyForwardBodyFormat(item, userContext);
                    }
                    bool flag3 = Utilities.IsSMimeControlNeededForEditForm(queryStringParameter, owaContext);
                    flag2 = ((flag3 && Utilities.IsSMime(item)) || flag);
                    bool flag4 = userContext.IsSmsEnabled && ObjectClass.IsSmsMessage(owaContext.FormsRegistryContext.Type);
                    ReplyForwardFlags replyForwardFlags = ReplyForwardFlags.None;
                    if (flag2)
                    {
                        replyForwardFlags |= ReplyForwardFlags.DropBody;
                    }
                    if (flag4 || flag)
                    {
                        replyForwardFlags |= ReplyForwardFlags.DropHeader;
                    }
                    StoreObjectId parentFolderId = Utilities.GetParentFolderId(item2, item);
                    item3 = ReplyForwardUtilities.CreateForwardItem(flag3 ? BodyFormat.TextHtml : bodyFormat, item, replyForwardFlags, userContext, parentFolderId);
                    if (flag)
                    {
                        item3.AttachmentCollection.RemoveAll();
                        using (ItemAttachment itemAttachment = item3.AttachmentCollection.AddExistingItem(item))
                        {
                            itemAttachment.Save();
                            goto IL_205;
                        }
                    }
                    if (Utilities.IsIrmRestrictedAndNotDecrypted(item))
                    {
                        ReplyForwardUtilities.SetAlternateIrmBody(item3, flag3 ? BodyFormat.TextHtml : bodyFormat, userContext, parentFolderId, decryptionStatus, ObjectClass.IsVoiceMessage(item.ClassName));
                        item3.AttachmentCollection.RemoveAll();
                    }
IL_205:
                    preFormActionResponse.Action = "Forward";
                    if (flag2)
                    {
                        preFormActionResponse.AddParameter("srcId", Utilities.GetItemIdQueryString(httpContext.Request));
                        if (Utilities.GetQueryStringParameter(httpContext.Request, "cb", false) == null && Utilities.IsWebBeaconsAllowed(item))
                        {
                            preFormActionResponse.AddParameter("cb", "1");
                        }
                    }
                    if (flag4)
                    {
                        item3.ClassName = "IPM.Note.Mobile.SMS";
                    }
                }
                item3.Save(SaveMode.ResolveConflicts);
                item3.Load();
                ReplyForwardUtilities.DeleteLevelOneAttachments(item3, userContext);
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type = item3.ClassName;
                preFormActionResponse.AddParameter("id", OwaStoreObjectId.CreateFromStoreObject(item3).ToBase64String());
                if (userContext.IsInOtherMailbox(item))
                {
                    preFormActionResponse.AddParameter("fOMF", "1");
                }
                if (flag)
                {
                    preFormActionResponse.AddParameter("fIrmAsAttach", "1");
                }
                result = preFormActionResponse;
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
                if (item3 != null)
                {
                    item3.Dispose();
                    item3 = null;
                }
            }
            return(result);
        }
        // Token: 0x060023CE RID: 9166 RVA: 0x000CE21C File Offset: 0x000CC41C
        protected override ListViewContents2 CreateListViewContents()
        {
            DefaultFolderType defaultFolderType = Utilities.GetDefaultFolderType(this.contextFolder);
            bool renderLastModifiedTime         = MessagePrefetchConfiguration.IsMessagePrefetchEnabledForSession(base.UserContext, this.dataFolder.Session);
            ListViewContents2 listViewContents;

            if (this.IsConversationView)
            {
                listViewContents = new ConversationItemList2(base.SortedColumn, base.SortOrder, base.UserContext, this.folderScope, defaultFolderType, OwaStoreObjectId.CreateFromStoreObject(this.contextFolder), renderLastModifiedTime);
                switch (base.SortedColumn)
                {
                case ColumnId.ConversationLastDeliveryTime:
                    listViewContents = new TimeGroupByList2(ColumnId.ConversationLastDeliveryTime, base.SortOrder, (ItemList2)listViewContents, base.UserContext);
                    break;

                case ColumnId.ConversationIcon:
                case ColumnId.ConversationSubject:
                case ColumnId.ConversationHasAttachment:
                case ColumnId.ConversationSenderList:
                case ColumnId.ConversationImportance:
                case ColumnId.ConversationFlagStatus:
                case ColumnId.ConversationToList:
                    listViewContents = base.CreateGroupByList(listViewContents);
                    break;

                case ColumnId.ConversationSize:
                    listViewContents = new SizeGroupByList2(ColumnId.ConversationSize, base.SortOrder, (ItemList2)listViewContents, base.UserContext);
                    break;
                }
                return(listViewContents);
            }
            ViewDescriptor viewDescriptor;

            if (defaultFolderType == DefaultFolderType.Drafts)
            {
                viewDescriptor = MessageVirtualListView2.MultiLineToDrafts;
            }
            else if (defaultFolderType == DefaultFolderType.DeletedItems)
            {
                viewDescriptor = MessageVirtualListView2.MultiLineFromDeletedItems;
            }
            else if (defaultFolderType == DefaultFolderType.SentItems || defaultFolderType == DefaultFolderType.Outbox)
            {
                viewDescriptor = MessageVirtualListView2.MultiLineTo;
            }
            else
            {
                viewDescriptor = MessageVirtualListView2.MultiLineFrom;
            }
            listViewContents = new MessageMultiLineList2(viewDescriptor, base.SortedColumn, base.SortOrder, base.UserContext, this.folderScope, renderLastModifiedTime);
            ColumnId sortedColumn = base.SortedColumn;

            switch (sortedColumn)
            {
            case ColumnId.DeliveryTime:
                listViewContents = new TimeGroupByList2(ColumnId.DeliveryTime, base.SortOrder, (ItemList2)listViewContents, base.UserContext);
                break;

            case ColumnId.SentTime:
                listViewContents = new TimeGroupByList2(ColumnId.SentTime, base.SortOrder, (ItemList2)listViewContents, base.UserContext);
                break;

            case ColumnId.Size:
                listViewContents = new SizeGroupByList2(base.SortOrder, (ItemList2)listViewContents, base.UserContext);
                break;

            default:
                switch (sortedColumn)
                {
                case ColumnId.FlagDueDate:
                    listViewContents = new FlagGroupByList2(ColumnId.FlagDueDate, base.SortOrder, (ItemList2)listViewContents, base.UserContext);
                    break;

                case ColumnId.FlagStartDate:
                    listViewContents = new FlagGroupByList2(ColumnId.FlagStartDate, base.SortOrder, (ItemList2)listViewContents, base.UserContext);
                    break;

                default:
                    listViewContents = base.CreateGroupByList(listViewContents);
                    break;
                }
                break;
            }
            return(listViewContents);
        }
        // Token: 0x06002E93 RID: 11923 RVA: 0x0010A058 File Offset: 0x00108258
        protected override OwaStoreObjectId GetSeekId()
        {
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("SId");

            if (owaStoreObjectId == null)
            {
                return(null);
            }
            if (!owaStoreObjectId.IsConversationId && this.IsConversationView)
            {
                ConversationId conversationId = ConversationUtilities.MapItemToConversation(base.UserContext, owaStoreObjectId);
                if (conversationId != null)
                {
                    this.newSeekId = OwaStoreObjectId.CreateFromConversationId(conversationId, base.DataFolder, null);
                }
            }
            else if (owaStoreObjectId.IsConversationId && !this.IsConversationView)
            {
                StoreObjectId storeObjectId = ConversationUtilities.MapConversationToItem(base.UserContext, owaStoreObjectId.ConversationId, OwaStoreObjectId.CreateFromStoreObject(base.DataFolder));
                if (storeObjectId != null)
                {
                    this.newSeekId = OwaStoreObjectId.CreateFromStoreObjectId(storeObjectId, owaStoreObjectId);
                }
            }
            return(this.newSeekId ?? owaStoreObjectId);
        }
Esempio n. 17
0
 // Token: 0x06002FD2 RID: 12242 RVA: 0x00116930 File Offset: 0x00114B30
 private static void GetConflictingAppointments(Infobar infobar, CalendarItemBase calendarItemBase, UserContext userContext)
 {
     if (Utilities.IsPublic(calendarItemBase))
     {
         return;
     }
     using (CalendarFolder calendarFolder = CalendarFolder.Bind(calendarItemBase.Session as MailboxSession, DefaultFolderType.Calendar))
     {
         AdjacencyOrConflictInfo[] adjacentOrConflictingItems = calendarFolder.GetAdjacentOrConflictingItems(calendarItemBase);
         if (adjacentOrConflictingItems != null && adjacentOrConflictingItems.Length != 0)
         {
             if (Utilities.IsOtherMailbox(calendarItemBase))
             {
                 CalendarUtilities.AddConflictingAppointmentsInfobarMessage(infobar, adjacentOrConflictingItems, userContext, calendarItemBase.CalendarItemType, Utilities.GetMailboxOwnerDisplayName((MailboxSession)calendarItemBase.Session), OwaStoreObjectId.CreateFromStoreObject(calendarFolder));
             }
             else
             {
                 CalendarUtilities.AddConflictingAppointmentsInfobarMessage(infobar, adjacentOrConflictingItems, userContext, calendarItemBase.CalendarItemType);
             }
         }
     }
 }
Esempio n. 18
0
        public void OpenOtherUserFolder()
        {
            base.ThrowIfCannotActAsOwner();
            if (base.UserContext.IsExplicitLogon)
            {
                throw new OwaInvalidRequestException("Cannot open other's folder in explict logon mode");
            }
            NavigationNodeGroupSection navigationNodeGroupSection = (NavigationNodeGroupSection)base.GetParameter("GS");

            if (navigationNodeGroupSection == NavigationNodeGroupSection.Contacts || navigationNodeGroupSection == NavigationNodeGroupSection.Tasks)
            {
                throw new OwaInvalidRequestException("Cannot open other's contacts/tasks folder");
            }
            DefaultFolderType defaultFolderType;

            switch (navigationNodeGroupSection)
            {
            case NavigationNodeGroupSection.Mail:
                defaultFolderType = DefaultFolderType.Inbox;
                break;

            case NavigationNodeGroupSection.Calendar:
                defaultFolderType = DefaultFolderType.Calendar;
                break;

            case NavigationNodeGroupSection.Contacts:
                defaultFolderType = DefaultFolderType.Contacts;
                break;

            case NavigationNodeGroupSection.Tasks:
                defaultFolderType = DefaultFolderType.Tasks;
                break;

            default:
                throw new OwaInvalidRequestException("Invalid group section: " + navigationNodeGroupSection.ToString());
            }
            RecipientInfoAC[] array = (RecipientInfoAC[])base.GetParameter("Recips");
            if (array != null && array.Length != 0)
            {
                AutoCompleteCache.UpdateAutoCompleteCacheFromRecipientInfoList(array, base.OwaContext.UserContext);
            }
            if (defaultFolderType != DefaultFolderType.Calendar)
            {
                Folder folder = null;
                if (base.IsParameterSet("RCP"))
                {
                    RecipientInfoAC   recipientInfoAC   = (RecipientInfoAC)base.GetParameter("RCP");
                    ExchangePrincipal exchangePrincipal = null;
                    if (base.UserContext.DelegateSessionManager.TryGetExchangePrincipal(recipientInfoAC.RoutingAddress, out exchangePrincipal))
                    {
                        if (string.Equals(base.UserContext.MailboxSession.MailboxOwnerLegacyDN, exchangePrincipal.LegacyDn, StringComparison.OrdinalIgnoreCase))
                        {
                            throw new OwaEventHandlerException("Cannot open own folder", LocalizedStrings.GetNonEncoded(-1770024075), true);
                        }
                        folder = this.GetOtherUserFolder(exchangePrincipal, defaultFolderType);
                    }
                }
                else
                {
                    if (!base.IsParameterSet("Id"))
                    {
                        throw new OwaInvalidRequestException("Must specific one of recipient and folder Id.");
                    }
                    OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("Id");
                    if (!owaStoreObjectId.IsOtherMailbox)
                    {
                        throw new OwaEventHandlerException("Cannot open own folder", LocalizedStrings.GetNonEncoded(-1770024075), true);
                    }
                    folder = Utilities.GetFolder <Folder>(base.UserContext, owaStoreObjectId, FolderList.FolderTreeQueryProperties);
                }
                try
                {
                    if (folder == null || !Utilities.CanReadItemInFolder(folder))
                    {
                        Strings.IDs localizedId = 1414246128;
                        switch (navigationNodeGroupSection)
                        {
                        case NavigationNodeGroupSection.Mail:
                            localizedId = -236167850;
                            break;

                        case NavigationNodeGroupSection.Contacts:
                            localizedId = -1505241540;
                            break;

                        case NavigationNodeGroupSection.Tasks:
                            localizedId = -65263937;
                            break;
                        }
                        throw new OwaEventHandlerException(LocalizedStrings.GetNonEncoded(995407892), LocalizedStrings.GetNonEncoded(localizedId), true);
                    }
                    MailboxSession mailboxSession = folder.Session as MailboxSession;
                    if (navigationNodeGroupSection == NavigationNodeGroupSection.Mail)
                    {
                        OtherMailboxConfigEntry otherMailboxConfigEntry = OtherMailboxConfiguration.AddOtherMailboxSession(base.UserContext, mailboxSession);
                        if (otherMailboxConfigEntry != null)
                        {
                            NavigationHost.RenderOtherMailboxFolderTree(this.Writer, base.UserContext, otherMailboxConfigEntry, true);
                        }
                    }
                    else
                    {
                        NavigationNodeCollection.AddNonMailFolderToSharedFoldersGroup(base.UserContext, folder, navigationNodeGroupSection);
                        OwaStoreObjectId owaStoreObjectId2 = OwaStoreObjectId.CreateFromStoreObject(folder);
                        NavigationHost.RenderFavoritesAndNavigationTrees(this.Writer, base.UserContext, owaStoreObjectId2, new NavigationNodeGroupSection[]
                        {
                            navigationNodeGroupSection
                        });
                        this.RenderOpenOtherUserFolderReponse(folder.ClassName, owaStoreObjectId2);
                    }
                }
                finally
                {
                    if (folder != null)
                    {
                        folder.Dispose();
                    }
                }
                return;
            }
            if (!base.IsParameterSet("RCP"))
            {
                throw new OwaInvalidRequestException("Recipient is missing for open other user's calendar request");
            }
            this.OpenOtherUserCalendar((RecipientInfoAC)base.GetParameter("RCP"));
        }
Esempio n. 19
0
        protected void RenderJavascriptEncodedMessageId()
        {
            string s = OwaStoreObjectId.CreateFromStoreObject(this.post).ToBase64String();

            Utilities.JavascriptEncode(s, base.Response.Output);
        }
        public void Save()
        {
            ExTraceGlobals.TasksCallTracer.TraceDebug((long)this.GetHashCode(), "EditTaskEventHandler.Save");
            bool       flag       = base.IsParameterSet("Id");
            bool       flag2      = false;
            bool       flag3      = false;
            ExDateTime?exDateTime = null;
            Task       task       = this.GetTask(new PropertyDefinition[0]);

            try
            {
                if (!base.IsParameterSet("Id"))
                {
                    OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("fId");
                    if (owaStoreObjectId != null && owaStoreObjectId.IsOtherMailbox)
                    {
                        ADSessionSettings adSettings        = Utilities.CreateScopedADSessionSettings(base.UserContext.LogonIdentity.DomainName);
                        ExchangePrincipal exchangePrincipal = ExchangePrincipal.FromLegacyDN(adSettings, owaStoreObjectId.MailboxOwnerLegacyDN);
                        task[TaskSchema.TaskOwner] = exchangePrincipal.MailboxInfo.DisplayName;
                    }
                    else
                    {
                        task[TaskSchema.TaskOwner] = base.UserContext.ExchangePrincipal.MailboxInfo.DisplayName;
                    }
                }
                if (base.IsParameterSet("subj"))
                {
                    task.Subject = (string)base.GetParameter("subj");
                }
                if (base.IsParameterSet("sd"))
                {
                    task.StartDate = this.GetDateValue("sd");
                }
                if (base.IsParameterSet("dd"))
                {
                    task.DueDate = this.GetDateValue("dd");
                }
                if (base.IsParameterSet("dc"))
                {
                    exDateTime = this.GetDateValue("dc");
                    if (exDateTime != null)
                    {
                        flag2 = true;
                    }
                }
                if (base.IsParameterSet("st"))
                {
                    TaskStatus taskStatus = (TaskStatus)base.GetParameter("st");
                    if (taskStatus == TaskStatus.Completed)
                    {
                        flag2 = true;
                    }
                    else
                    {
                        TaskUtilities.SetIncomplete(task, taskStatus);
                    }
                }
                if (base.IsParameterSet("pri"))
                {
                    task[ItemSchema.Importance] = (Importance)base.GetParameter("pri");
                }
                if (base.IsParameterSet("pc"))
                {
                    double num = (double)((int)base.GetParameter("pc")) / 100.0;
                    if (!flag2 || num != 1.0)
                    {
                        if (num >= 0.0 && num < 1.0)
                        {
                            task.PercentComplete = num;
                        }
                        else if (num == 1.0)
                        {
                            flag2 = true;
                        }
                    }
                }
                if (base.IsParameterSet("rs"))
                {
                    bool flag4 = (bool)base.GetParameter("rs");
                    task[ItemSchema.ReminderIsSet] = flag4;
                    if (flag4 && base.IsParameterSet("rd"))
                    {
                        ExDateTime?dateValue = this.GetDateValue("rd");
                        if (dateValue != null)
                        {
                            task[ItemSchema.ReminderDueBy] = dateValue.Value;
                        }
                    }
                }
                if (base.IsParameterSet("ps"))
                {
                    task[ItemSchema.Sensitivity] = (((bool)base.GetParameter("ps")) ? Sensitivity.Private : Sensitivity.Normal);
                }
                if (base.IsParameterSet("tw"))
                {
                    int num2 = (int)base.GetParameter("tw");
                    if (num2 < 0 || num2 > 1525252319)
                    {
                        throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(-1310086288));
                    }
                    task[TaskSchema.TotalWork] = num2;
                }
                if (base.IsParameterSet("aw"))
                {
                    int num3 = (int)base.GetParameter("aw");
                    if (num3 < 0 || num3 > 1525252319)
                    {
                        throw new OwaInvalidRequestException(LocalizedStrings.GetNonEncoded(210380742));
                    }
                    task[TaskSchema.ActualWork] = num3;
                }
                if (base.IsParameterSet("mi"))
                {
                    task[TaskSchema.Mileage] = (string)base.GetParameter("mi");
                }
                if (base.IsParameterSet("bl"))
                {
                    task[TaskSchema.BillingInformation] = (string)base.GetParameter("bl");
                }
                if (base.IsParameterSet("co"))
                {
                    string   text = (string)base.GetParameter("co");
                    string[] value;
                    if (string.IsNullOrEmpty(text))
                    {
                        value = new string[0];
                    }
                    else
                    {
                        value = new string[]
                        {
                            text
                        };
                    }
                    task[TaskSchema.Companies] = value;
                }
                if (base.IsParameterSet("nt"))
                {
                    string text2 = (string)base.GetParameter("nt");
                    if (text2 != null)
                    {
                        BodyConversionUtilities.SetBody(task, text2, Markup.PlainText, base.UserContext);
                    }
                }
                if (base.IsParameterSet("RcrT"))
                {
                    Recurrence recurrence = base.CreateRecurrenceFromRequest();
                    if ((recurrence != null || task.Recurrence != null) && (recurrence == null || task.Recurrence == null || !recurrence.Equals(task.Recurrence)))
                    {
                        task.Recurrence = recurrence;
                        flag3           = true;
                    }
                }
                if (flag2 && exDateTime == null)
                {
                    if (task.CompleteDate == null)
                    {
                        exDateTime = new ExDateTime?(DateTimeUtilities.GetLocalTime());
                    }
                    else
                    {
                        exDateTime = new ExDateTime?(task.CompleteDate.Value);
                    }
                }
                if (!flag3 && flag2)
                {
                    task.SetStatusCompleted(exDateTime.Value);
                }
                Utilities.SaveItem(task, flag);
                task.Load();
                if (flag3 && flag2)
                {
                    OwaStoreObjectId owaStoreObjectId2 = OwaStoreObjectId.CreateFromStoreObject(task);
                    string           changeKey         = task.Id.ChangeKeyAsBase64String();
                    task.Dispose();
                    task = Utilities.GetItem <Task>(base.UserContext, owaStoreObjectId2, changeKey, TaskUtilities.TaskPrefetchProperties);
                    task.SetStatusCompleted(exDateTime.Value);
                    Utilities.SaveItem(task);
                    task.Load();
                }
                if (!flag)
                {
                    OwaStoreObjectId owaStoreObjectId3 = OwaStoreObjectId.CreateFromStoreObject(task);
                    if (ExTraceGlobals.TasksDataTracer.IsTraceEnabled(TraceType.DebugTrace))
                    {
                        ExTraceGlobals.TasksDataTracer.TraceDebug <string>((long)this.GetHashCode(), "New task item ID is '{0}'", owaStoreObjectId3.ToBase64String());
                    }
                    this.Writer.Write("<div id=itemId>");
                    this.Writer.Write(owaStoreObjectId3.ToBase64String());
                    this.Writer.Write("</div>");
                }
                this.Writer.Write("<div id=ck>");
                this.Writer.Write(task.Id.ChangeKeyAsBase64String());
                this.Writer.Write("</div>");
                base.MoveItemToDestinationFolderIfInScratchPad(task);
            }
            finally
            {
                task.Dispose();
            }
        }
Esempio n. 21
0
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            applicationElement = ApplicationElement.Item;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse();
            Item item  = null;
            Item item2 = null;
            Item item3 = null;

            try
            {
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type   = owaContext.FormsRegistryContext.Type;
                preFormActionResponse.State  = owaContext.FormsRegistryContext.State;
                preFormActionResponse.Action = "New";
                string type2;
                if ((type2 = preFormActionResponse.Type) != null)
                {
                    StoreObjectId storeObjectId;
                    if (!(type2 == "IPM.Contact"))
                    {
                        if (!(type2 == "IPM.DistList"))
                        {
                            if (!(type2 == "IPM.Task"))
                            {
                                goto IL_102;
                            }
                            storeObjectId = owaContext.UserContext.TasksFolderId;
                            item          = Utilities.GetItemForRequest <Task>(owaContext, out item2, false, new PropertyDefinition[0]);
                        }
                        else
                        {
                            storeObjectId = owaContext.UserContext.ContactsFolderId;
                            item          = Utilities.GetItemForRequest <DistributionList>(owaContext, out item2, false, new PropertyDefinition[0]);
                        }
                    }
                    else
                    {
                        storeObjectId = owaContext.UserContext.ContactsFolderId;
                        item          = Utilities.GetItemForRequest <Contact>(owaContext, out item2, false, new PropertyDefinition[0]);
                    }
                    if (item.MapiMessage == null)
                    {
                        item3 = MessageItem.Create(owaContext.UserContext.MailboxSession, storeObjectId);
                        Item.CopyItemContent(item, item3);
                    }
                    else
                    {
                        item3 = Item.CloneItem(owaContext.UserContext.MailboxSession, storeObjectId, item, false, false, null);
                    }
                    Utilities.SaveItem(item3);
                    item3.Load();
                    HttpRequest request = owaContext.HttpContext.Request;
                    if (Utilities.GetQueryStringParameter(request, "smemb", false) != null)
                    {
                        Utilities.Delete(owaContext.UserContext, true, false, new OwaStoreObjectId[]
                        {
                            OwaStoreObjectId.CreateFromStoreObject(item)
                        });
                    }
                    preFormActionResponse.AddParameter("id", item3.Id.ObjectId.ToBase64String());
                    preFormActionResponse.AddParameter("exdltdrft", "1");
                    return(preFormActionResponse);
                }
IL_102:
                throw new OwaInvalidRequestException("Item should be contact or PDL or task.");
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
                if (item3 != null)
                {
                    item3.Dispose();
                    item3 = null;
                }
            }
            return(preFormActionResponse);
        }
        // Token: 0x06002DB9 RID: 11705 RVA: 0x00102FA4 File Offset: 0x001011A4
        private void NonEditResponseInternal(bool sendResponse)
        {
            ResponseType     responseType     = (ResponseType)base.GetParameter("Rsp");
            StoreObjectType  storeObjectType  = (StoreObjectType)base.GetParameter("ItemType");
            MeetingRequest   meetingRequest   = null;
            CalendarItemBase calendarItemBase = null;

            try
            {
                StoreObjectType storeObjectType2 = storeObjectType;
                if (storeObjectType2 != StoreObjectType.MeetingRequest)
                {
                    if (storeObjectType2 == StoreObjectType.CalendarItem)
                    {
                        calendarItemBase = base.GetRequestItem <CalendarItemBase>(new PropertyDefinition[0]);
                        MeetingUtilities.ThrowIfMeetingResponseInvalid(calendarItemBase);
                    }
                }
                else
                {
                    this.properties = new PropertyDefinition[]
                    {
                        MeetingMessageSchema.CalendarProcessed,
                        StoreObjectSchema.ParentItemId
                    };
                    meetingRequest   = this.GetMeetingRequest(this.properties);
                    calendarItemBase = MeetingUtilities.UpdateCalendarItem(meetingRequest);
                    if (calendarItemBase == null)
                    {
                        throw new OwaInvalidRequestException(string.Format("calendarItem associated with meetingRequest with Id {0} is null.", base.GetParameter("Id")));
                    }
                }
                this.UpdateItem(calendarItemBase);
                Utilities.SaveItem(calendarItemBase);
                calendarItemBase.Load();
                MeetingUtilities.NonEditResponse(responseType, calendarItemBase, sendResponse, null);
                calendarItemBase.Load();
                if (meetingRequest != null)
                {
                    this.UpdateItem(meetingRequest);
                    Utilities.SaveItem(meetingRequest);
                    MeetingUtilities.DeleteMeetingRequestAfterResponse(meetingRequest);
                }
                if (storeObjectType == StoreObjectType.CalendarItem)
                {
                    this.Writer.Write("<div id=nid>");
                    this.Writer.Write(OwaStoreObjectId.CreateFromStoreObject(calendarItemBase).ToBase64String());
                    this.Writer.Write("</div>");
                }
            }
            finally
            {
                if (meetingRequest != null)
                {
                    meetingRequest.Dispose();
                    meetingRequest = null;
                }
                if (calendarItemBase != null)
                {
                    calendarItemBase.Dispose();
                    calendarItemBase = null;
                }
            }
        }
Esempio n. 23
0
        public void New()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "TreeEventHandler.New");
            OwaStoreObjectId owaStoreObjectId = (OwaStoreObjectId)base.GetParameter("destId");

            if (owaStoreObjectId.IsOtherMailbox)
            {
                throw new OwaInvalidRequestException("Cannot add new folder underneath a shared folder");
            }
            string text       = (string)base.GetParameter("fC");
            string text2      = (string)base.GetParameter("fN");
            bool   isExpanded = (bool)base.GetParameter("exp");

            if (Utilities.IsDefaultFolderId(base.UserContext, owaStoreObjectId, DefaultFolderType.SearchFolders))
            {
                throw new OwaInvalidRequestException("Cannot Create new Search Folder through OWA");
            }
            if (Utilities.IsELCRootFolder(owaStoreObjectId, base.UserContext))
            {
                throw new OwaInvalidRequestException("Cannot create new folders under the root ELC folder.");
            }
            text2 = text2.Trim();
            if (text2.Length == 0)
            {
                throw new OwaEventHandlerException("User did not provide name for new folder", LocalizedStrings.GetNonEncoded(-41080803), true);
            }
            StoreObjectType objectType = owaStoreObjectId.StoreObjectId.ObjectType;

            if (!this.CanFolderHaveSubFolders(owaStoreObjectId))
            {
                throw new OwaInvalidRequestException("Cannot Create new Search Folder through OWA");
            }
            using (Folder folder = Utilities.CreateSubFolder(owaStoreObjectId, objectType, text2, base.UserContext))
            {
                folder.ClassName = text;
                try
                {
                    folder.Save();
                }
                catch (ObjectExistedException)
                {
                    throw;
                }
                catch (StoragePermanentException innerException)
                {
                    throw new OwaAccessDeniedException(LocalizedStrings.GetNonEncoded(995407892), innerException);
                }
                folder.Load();
                OwaStoreObjectId newFolderId = OwaStoreObjectId.CreateFromStoreObject(folder);
                this.RenderFolderTreeChangedNode(owaStoreObjectId, newFolderId, isExpanded, owaStoreObjectId.IsArchive, (FolderTreeRenderType)base.GetParameter("rdt"));
                NavigationTreeDirtyFlag navigationTreeDirtyFlag = FolderTreeNode.GetAffectedTreeFromContainerClass(text);
                if (owaStoreObjectId.IsArchive)
                {
                    navigationTreeDirtyFlag |= NavigationTreeDirtyFlag.Favorites;
                }
                if (navigationTreeDirtyFlag != NavigationTreeDirtyFlag.Favorites || owaStoreObjectId.IsArchive)
                {
                    RenderingUtilities.RenderNavigationTreeDirtyFlag(this.Writer, base.UserContext, navigationTreeDirtyFlag, (NavigationModule[])base.GetParameter("cms"));
                }
            }
        }
Esempio n. 24
0
        public PreFormActionResponse Execute(OwaContext owaContext, out ApplicationElement applicationElement, out string type, out string state, out string action)
        {
            if (owaContext == null)
            {
                throw new ArgumentNullException("owaContext");
            }
            HttpContext httpContext = owaContext.HttpContext;

            if (httpContext == null)
            {
                throw new ArgumentNullException("httpContext");
            }
            applicationElement = ApplicationElement.NotSet;
            type   = string.Empty;
            action = string.Empty;
            state  = string.Empty;
            PreFormActionResponse preFormActionResponse = new PreFormActionResponse(httpContext.Request, new string[]
            {
                "smime"
            });
            Item item  = null;
            Item item2 = null;
            Item item3 = null;

            try
            {
                UserContext          userContext        = owaContext.UserContext;
                PropertyDefinition[] prefetchProperties = new PropertyDefinition[]
                {
                    ItemSchema.SentTime
                };
                item  = Utilities.GetItemForRequest <MessageItem>(owaContext, out item3, prefetchProperties);
                item2 = ((ReportMessage)item).CreateSendAgain(userContext.DraftsFolderId);
                if (Utilities.IrmDecryptIfRestricted(item2, userContext, true))
                {
                    ((RightsManagedMessageItem)item2).PrepareAcquiredLicensesBeforeSave();
                }
                item2.Save(SaveMode.ResolveConflicts);
                item2.Load();
                owaContext.PreFormActionId = OwaStoreObjectId.CreateFromStoreObject(item2);
                preFormActionResponse.ApplicationElement = ApplicationElement.Item;
                preFormActionResponse.Type   = item2.ClassName;
                preFormActionResponse.Action = "Open";
                preFormActionResponse.State  = "Draft";
                preFormActionResponse.AddParameter("exdltdrft", "1");
            }
            finally
            {
                if (item != null)
                {
                    item.Dispose();
                    item = null;
                }
                if (item3 != null)
                {
                    item3.Dispose();
                    item3 = null;
                }
                if (item2 != null)
                {
                    item2.Dispose();
                    item2 = null;
                }
            }
            return(preFormActionResponse);
        }