public void GetELCFolderSize()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "MessageVirtualListViewEventHandler.GetELCFolderSize");
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromString((string)base.GetParameter("fId"));

            if (owaStoreObjectId.IsPublic)
            {
                throw new OwaInvalidRequestException("Cannot get ELC size for public folders");
            }
            using (Folder folder = Utilities.GetFolder <Folder>(base.UserContext, owaStoreObjectId, new PropertyDefinition[]
            {
                FolderSchema.FolderSize
            }))
            {
                long   value = 0L;
                object obj   = folder.TryGetProperty(FolderSchema.FolderSize);
                if (!(obj is PropertyError))
                {
                    value = (long)((int)obj);
                }
                this.Writer.Write("<div id=\"fldSz\">");
                this.Writer.Write(value);
                this.Writer.Write("</div>");
            }
        }
Esempio n. 2
0
        // Token: 0x060020D7 RID: 8407 RVA: 0x000BD350 File Offset: 0x000BB550
        protected override void OnLoad(EventArgs e)
        {
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "exdltdrft", false);

            if (!string.IsNullOrEmpty(queryStringParameter))
            {
                this.DeleteExistingDraft = true;
            }
            string queryStringParameter2 = Utilities.GetQueryStringParameter(base.Request, "fId", false);

            if (queryStringParameter2 != null)
            {
                this.targetFolderId = OwaStoreObjectId.CreateFromString(queryStringParameter2);
            }
            if (base.Item == null)
            {
                string queryStringParameter3 = Utilities.GetQueryStringParameter(base.Request, "email", false);
                if (!string.IsNullOrEmpty(queryStringParameter3))
                {
                    StoreObjectId mailboxItemStoreObjectId = null;
                    if (MailToParser.TryParseMailTo(queryStringParameter3, base.UserContext, out mailboxItemStoreObjectId))
                    {
                        base.OwaContext.PreFormActionId = OwaStoreObjectId.CreateFromMailboxItemId(mailboxItemStoreObjectId);
                        this.DeleteExistingDraft        = true;
                    }
                }
            }
            string queryStringParameter4 = Utilities.GetQueryStringParameter(base.Request, "fRABcc", false);

            this.isReplyAllBcc = (0 == string.CompareOrdinal("1", queryStringParameter4));
        }
Esempio n. 3
0
        internal void MarkPayloadAsRead()
        {
            string queryStringParameter = Utilities.GetQueryStringParameter(this.Request, "mrd", false);

            if (queryStringParameter != null)
            {
                JunkEmailStatus junkEmailStatus       = JunkEmailStatus.Unknown;
                string          queryStringParameter2 = Utilities.GetQueryStringParameter(this.Request, "JS", false);
                int             num;
                if (queryStringParameter2 != null && int.TryParse(queryStringParameter2, out num) && (num == 1 || num == 0))
                {
                    junkEmailStatus = (JunkEmailStatus)num;
                }
                OwaStoreObjectId   owaStoreObjectId = OwaStoreObjectId.CreateFromString(queryStringParameter);
                OwaStoreObjectId[] localItemIds     = ConversationUtilities.GetLocalItemIds(this.UserContext, new OwaStoreObjectId[]
                {
                    owaStoreObjectId
                }, null, new PropertyDefinition[]
                {
                    MessageItemSchema.IsRead
                }, (IStorePropertyBag propertyBag) => !ItemUtility.GetProperty <bool>(propertyBag, MessageItemSchema.IsRead, true));
                if (localItemIds.Length > 0)
                {
                    Utilities.MarkItemsAsRead(this.UserContext, localItemIds, junkEmailStatus, false);
                }
            }
        }
Esempio n. 4
0
        private void ProcessPost()
        {
            string text       = base.Request.Form["mId"];
            string text2      = base.Request.Form["mCK"];
            string bodyMarkup = base.Request.Form["sHtmlBdy"];

            if (!string.IsNullOrEmpty(text) && !string.IsNullOrEmpty(text2))
            {
                this.item = Utilities.GetItem <Item>(base.UserContext, text, text2, new PropertyDefinition[0]);
                if (base.UserContext.IsIrmEnabled)
                {
                    Utilities.IrmDecryptIfRestricted(this.item, base.UserContext, true);
                }
            }
            else
            {
                StoreObjectType itemType = StoreObjectType.Message;
                string          text3    = base.Request.Form["iT"];
                int             num;
                if (text3 != null && int.TryParse(text3, NumberStyles.Integer, CultureInfo.InvariantCulture, out num))
                {
                    itemType = (StoreObjectType)num;
                }
                OwaStoreObjectId destinationFolderId = null;
                string           text4 = base.Request.Form["sFldId"];
                if (!string.IsNullOrEmpty(text4))
                {
                    destinationFolderId = OwaStoreObjectId.CreateFromString(text4);
                }
                this.item = Utilities.CreateImplicitDraftItem(itemType, destinationFolderId);
                this.item.Save(SaveMode.ResolveConflicts);
                this.item.Load();
                if (Globals.ArePerfCountersEnabled)
                {
                    OwaSingleCounters.ItemsCreated.Increment();
                }
            }
            this.attachmentLinks = new List <SanitizedHtmlString>(base.Request.Files.Count);
            if (!this.IsInline)
            {
                this.attachResult = AttachmentUtility.AddAttachment(this.item, base.Request.Files, base.UserContext, false, bodyMarkup);
            }
            else
            {
                this.attachResult = AttachmentUtility.AddAttachment(this.item, base.Request.Files, base.UserContext, true, bodyMarkup, out this.attachmentLinks);
            }
            this.item.Load();
            if (Globals.ArePerfCountersEnabled)
            {
                OwaSingleCounters.ItemsUpdated.Increment();
            }
            if (!this.IsInline)
            {
                this.attachmentWellRenderObjects = null;
                bool isPublicLogon = base.UserContext.IsPublicLogon;
                this.attachmentWellRenderObjects = AttachmentWell.GetAttachmentInformation(this.item, null, isPublicLogon);
            }
        }
        public void GetDeliveryReportUrlParameters()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "MessageVirtualListViewEventHandler.GetDeliveryReportUrlParameters");
            this.Writer.Write("<div id=\"sMBX\">");
            Utilities.HtmlEncode(base.UserContext.ExchangePrincipal.ObjectId.ObjectGuid.ToString("N"), this.SanitizingWriter);
            this.Writer.Write("</div>");
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromString((string)base.GetParameter("id"));
            string           s = Convert.ToBase64String(owaStoreObjectId.StoreObjectId.ProviderLevelItemId);

            this.Writer.Write("<div id=\"sEID\">");
            Utilities.HtmlEncode(s, this.SanitizingWriter);
            this.Writer.Write("</div>");
        }
Esempio n. 6
0
        // Token: 0x060028C9 RID: 10441 RVA: 0x000E772C File Offset: 0x000E592C
        protected override void CreateDraftMessage()
        {
            string           queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "fldId");
            OwaStoreObjectId owaStoreObjectId     = OwaStoreObjectId.CreateFromString(queryStringParameter);

            if (owaStoreObjectId.OwaStoreObjectIdType != OwaStoreObjectIdType.MailBoxObject)
            {
                throw new OwaInvalidRequestException("Cannot share this calendar");
            }
            try
            {
                if (this.isPublishing)
                {
                    try
                    {
                        this.sharingMessage = SharingMessageItem.CreateForPublishing(base.UserContext.MailboxSession, base.UserContext.DraftsFolderId, owaStoreObjectId.StoreId);
                        goto IL_90;
                    }
                    catch (FolderNotPublishedException innerException)
                    {
                        throw new OwaInvalidRequestException("Folder is not published", innerException);
                    }
                }
                this.sharingMessage = SharingMessageItem.Create(base.UserContext.MailboxSession, base.UserContext.DraftsFolderId, owaStoreObjectId.StoreId);
IL_90:
                base.Item = (base.Message = this.sharingMessage);
            }
            catch (InvalidOperationException innerException2)
            {
                ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "Failed to create sharing message: no compatible provider for the share folder was found.");
                throw new OwaInvalidRequestException("Failed to create sharing message: no compatible provider for the share folder was found.", innerException2);
            }
            catch (CannotShareFolderException innerException3)
            {
                throw new OwaInvalidRequestException("Failed to create sharing message:  This folder has been shared with you and can't be shared with any other recipients.", innerException3);
            }
            this.sharingMessage.Save(SaveMode.ResolveConflicts);
            this.sharingMessage.Load();
            this.newItemType         = NewItemType.ImplicitDraft;
            base.DeleteExistingDraft = true;
            if (this.IsDefaultFolderToBeShared)
            {
                this.sharingMessage.Subject = string.Format(base.UserContext.UserCulture, LocalizedStrings.GetNonEncoded(this.isPublishing ? -1266131020 : -2015069592), new object[0]);
                return;
            }
            this.sharingMessage.Subject = string.Format(base.UserContext.UserCulture, LocalizedStrings.GetNonEncoded(this.isPublishing ? -1899057801 : 222110147), new object[]
            {
                this.sharingMessage.SharedFolderName
            });
        }
Esempio n. 7
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            string parameter = base.GetParameter("id", true);

            this.searchWords    = base.GetParameter("sw", false);
            this.conversationId = OwaStoreObjectId.CreateFromString(parameter);
            this.conversation   = ConversationUtilities.LoadConversation(base.UserContext, this.conversationId, ItemPartWriter.GetRequestedProperties());
            this.conversation.TrimToNewest(Globals.MaxItemsInConversationReadingPane);
            MailboxSession mailboxSession = (MailboxSession)this.conversationId.GetSession(base.UserContext);

            this.sentItemsFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.SentItems);
            this.localItemIds      = ConversationUtilities.GetLocalItemIds(mailboxSession, this.conversation, this.conversationId.ParentFolderId);
            base.OwaContext.ShouldDeferInlineImages = !base.IsInOEHResponse;
            this.conversation.OnBeforeItemLoad     += ItemPartWriter.OnBeforeItemLoad;
        }
        protected override void OnLoad(EventArgs e)
        {
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "id", true);

            if (OwaStoreObjectId.CreateFromString(queryStringParameter).IsPublic)
            {
                throw new OwaInvalidRequestException("Cannot open item in public folder with this form");
            }
            base.Message = (this.sharingMessageItem = base.Initialize <SharingMessageItem>(ReadSharingMessage.PrefetchProperties));
            base.InitializeReadMessageFormElements();
            this.sharingMessageWriter = new SharingMessageWriter(this.sharingMessageItem, base.UserContext);
            if (!this.sharingMessageItem.IsDraft)
            {
                this.AddMessagesToInfobar();
            }
        }
        // Token: 0x0600281A RID: 10266 RVA: 0x000E3098 File Offset: 0x000E1298
        private void InitializeMeetingResponse()
        {
            MeetingResponse meetingResponse = (MeetingResponse)base.Item;

            this.responseType = meetingResponse.ResponseType;
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "mid", false);

            if (queryStringParameter != null)
            {
                this.meetingRequestId = OwaStoreObjectId.CreateFromString(queryStringParameter);
            }
            this.isMeetingInviteInDeleteItems = (Utilities.GetQueryStringParameter(base.Request, "d", false) != null);
            this.infobar.AddMessage(SanitizedHtmlString.FromStringId(-1981719796), InfobarMessageType.Informational);
            string format = string.Empty;

            switch (this.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.isSendOnBehalfOf)
            {
                messageHtml = SanitizedHtmlString.Format(format, new object[]
                {
                    meetingResponse.From.DisplayName
                });
            }
            else
            {
                messageHtml = SanitizedHtmlString.Format(format, new object[]
                {
                    LocalizedStrings.GetNonEncoded(372029413)
                });
            }
            this.infobar.AddMessage(messageHtml, InfobarMessageType.Informational);
        }
        protected override void LoadViewState()
        {
            OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromString(Utilities.GetQueryStringParameter(base.Request, "id"));
            MailboxSession   mailboxSession   = (MailboxSession)owaStoreObjectId.GetSession(base.UserContext);
            StoreObjectId    defaultFolderId  = mailboxSession.GetDefaultFolderId(DefaultFolderType.RecoverableItemsDeletions);

            if (defaultFolderId == null)
            {
                DumpsterFolderHelper.CheckAndCreateFolder(mailboxSession);
                defaultFolderId = mailboxSession.GetDefaultFolderId(DefaultFolderType.RecoverableItemsDeletions);
            }
            OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromStoreObjectId(defaultFolderId, owaStoreObjectId);

            this.folder     = Utilities.GetFolderForContent <Folder>(base.UserContext, folderId, RecoverDeletedItems.folderProperties);
            this.viewWidth  = Utilities.GetFolderProperty <int>(this.folder, ViewStateProperties.ViewWidth, 450);
            this.viewHeight = Utilities.GetFolderProperty <int>(this.folder, ViewStateProperties.ViewHeight, 250);
        }
Esempio n. 11
0
        public static IList <TargetFolderMRUEntry> AddAndGetFolders(OwaStoreObjectId folderId, UserContext userContext)
        {
            SimpleConfiguration <TargetFolderMRUEntry> simpleConfiguration = new SimpleConfiguration <TargetFolderMRUEntry>(userContext);

            simpleConfiguration.Load();
            bool flag = false;
            ReadOnlyCollection <TargetFolderMRUEntry> result = new ReadOnlyCollection <TargetFolderMRUEntry>(simpleConfiguration.Entries);

            while (simpleConfiguration.Entries.Count > 10)
            {
                simpleConfiguration.Entries.RemoveAt(10);
                flag = true;
            }
            int i = 0;

            while (i < simpleConfiguration.Entries.Count)
            {
                OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromString(simpleConfiguration.Entries[i].FolderId);
                if (owaStoreObjectId.Equals(folderId))
                {
                    if (i == 0)
                    {
                        if (flag)
                        {
                            simpleConfiguration.Save();
                        }
                        return(result);
                    }
                    simpleConfiguration.Entries.RemoveAt(i);
                    break;
                }
                else
                {
                    i++;
                }
            }
            if (simpleConfiguration.Entries.Count == 10)
            {
                simpleConfiguration.Entries.RemoveAt(9);
            }
            simpleConfiguration.Entries.Insert(0, new TargetFolderMRUEntry(folderId));
            simpleConfiguration.Save();
            return(result);
        }
Esempio n. 12
0
        public void AddSender()
        {
            JunkEmailListType junkEmailListType = (JunkEmailListType)base.GetParameter("iLT");
            string            text = (string)base.GetParameter("sId");
            bool flag = (bool)base.GetParameter("fDmn");

            if (OwaStoreObjectId.CreateFromString(text).IsConversationId)
            {
                return;
            }
            string s                 = string.Empty;
            bool   flag2             = false;
            string senderSmtpAddress = Utilities.GetSenderSmtpAddress(text, base.UserContext);

            if (string.IsNullOrEmpty(senderSmtpAddress))
            {
                flag2 = true;
                s     = LocalizedStrings.GetNonEncoded(-562376136);
            }
            else
            {
                int num = senderSmtpAddress.IndexOf('@');
                if (num < 0)
                {
                    flag2 = true;
                    s     = LocalizedStrings.GetNonEncoded(-562376136);
                }
                else
                {
                    int length = senderSmtpAddress.Length;
                    if (!JunkEmailUtilities.Add(flag ? senderSmtpAddress.Substring(num, length - num) : senderSmtpAddress, junkEmailListType, base.UserContext, false, out s))
                    {
                        flag2 = true;
                    }
                }
            }
            if (flag2)
            {
                this.Writer.Write("<div id=fErr>1</div>");
            }
            this.Writer.Write("<div id=sMsg>{0}</div>", Utilities.HtmlEncode(s));
        }
Esempio n. 13
0
        // Token: 0x06002594 RID: 9620 RVA: 0x000D9874 File Offset: 0x000D7A74
        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   = "IPM.Note";
            action = this.Action;
            state  = null;
            string           queryStringParameter  = Utilities.GetQueryStringParameter(owaContext.HttpContext.Request, "id", true);
            string           queryStringParameter2 = Utilities.GetQueryStringParameter(owaContext.HttpContext.Request, "t", true);
            UserContext      userContext           = owaContext.UserContext;
            OwaStoreObjectId owaStoreObjectId      = OwaStoreObjectId.CreateFromString(queryStringParameter);

            if (queryStringParameter2 == "IPM.Sharing" && !owaStoreObjectId.IsPublic)
            {
                using (SharingMessageItem item = Utilities.GetItem <SharingMessageItem>(userContext, owaStoreObjectId, new PropertyDefinition[0]))
                {
                    StoreObjectId     parentId          = item.ParentId;
                    bool              flag              = Utilities.IsItemInDefaultFolder(item, DefaultFolderType.JunkEmail);
                    DefaultFolderType defaultFolderType = DefaultFolderType.None;
                    try
                    {
                        defaultFolderType = item.SharedFolderType;
                    }
                    catch (NotSupportedSharingMessageException ex)
                    {
                        ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "Cannot handle this sharing message due to {0}", ex.Message);
                    }
                    if (defaultFolderType == DefaultFolderType.Calendar && !flag)
                    {
                        type = "IPM.Sharing";
                        if (item.IsDraft)
                        {
                            state = "Draft";
                        }
                    }
                }
            }
            return(null);
        }
Esempio n. 14
0
        public void Expand()
        {
            ExTraceGlobals.MailCallTracer.TraceDebug((long)this.GetHashCode(), "TreeEventHandler.Expand");
            string text = (string)base.GetParameter("id");
            bool   flag = false;

            if (OwaStoreObjectId.IsDummyArchiveFolder(text))
            {
                text = base.UserContext.GetArchiveRootFolderIdString();
                flag = !string.IsNullOrEmpty(text);
            }
            this.RenderFolderTreeChangedNode(OwaStoreObjectId.CreateFromString(text), null, true, flag, (FolderTreeRenderType)base.GetParameter("rdt"));
            if (flag)
            {
                NavigationHost.RenderFavoritesAndNavigationTrees(this.Writer, base.UserContext, null, new NavigationNodeGroupSection[]
                {
                    NavigationNodeGroupSection.First
                });
            }
        }
Esempio n. 15
0
        protected override void OnLoad(EventArgs e)
        {
            this.selectedDate = (this.startDateTime = Utilities.GetQueryStringParameterDateTime(base.Request, "sd", base.UserContext.TimeZone));
            this.endDateTime  = Utilities.GetQueryStringParameterDateTime(base.Request, "ed", base.UserContext.TimeZone);
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "fid", false);

            if (!string.IsNullOrEmpty(queryStringParameter))
            {
                this.folderId = OwaStoreObjectId.CreateFromString(queryStringParameter);
            }
            if (this.startDateTime < this.endDateTime)
            {
                this.meetingDuration = (int)(this.endDateTime - this.startDateTime).TotalMinutes;
            }
            DatePickerBase.GetVisibleDateRange(this.selectedDate, out this.startDateTime, out this.endDateTime, base.UserContext.TimeZone);
            if (this.selectedDate.TimeOfDay.TotalMinutes < (double)this.WorkingHours.GetWorkDayStartTime(this.selectedDate) || (double)this.WorkingHours.GetWorkDayEndTime(this.selectedDate) <= this.selectedDate.TimeOfDay.TotalMinutes || (double)this.WorkingHours.GetWorkDayEndTime(this.selectedDate) < this.selectedDate.TimeOfDay.TotalMinutes + (double)this.meetingDuration || this.ForceShowing24Hours)
            {
                this.show24Hours = true;
            }
            this.recipientWell = new CalendarItemRecipientWell();
        }
Esempio n. 16
0
        private void RenderCategories(TextWriter writer, bool conversationMode)
        {
            string[] itemProperty = this.dataSource.GetItemProperty <string[]>(conversationMode ? ConversationItemSchema.ConversationCategories : ItemSchema.Categories, null);
            writer.Write("<div id=\"");
            writer.Write("divCatGroup");
            writer.Write("\"");
            if (this.userContext.CanActAsOwner && itemProperty != null && 0 < itemProperty.Length)
            {
                writer.Write(" title=\"");
                for (int i = 0; i < itemProperty.Length; i++)
                {
                    if (i != 0)
                    {
                        writer.Write("; ");
                    }
                    Utilities.HtmlEncode(itemProperty[i], writer);
                }
                writer.Write("\"");
            }
            writer.Write(">");
            int        itemColorInt = -1;
            bool       isToDoItem   = false;
            FlagStatus itemProperty2;

            if (conversationMode)
            {
                itemProperty2 = (FlagStatus)this.dataSource.GetItemProperty <int>(ConversationItemSchema.ConversationFlagStatus, 0);
            }
            else
            {
                itemProperty2 = this.dataSource.GetItemProperty <FlagStatus>(ItemSchema.FlagStatus, FlagStatus.NotFlagged);
                itemColorInt  = this.dataSource.GetItemProperty <int>(ItemSchema.ItemColor, -1);
                isToDoItem    = this.dataSource.GetItemProperty <bool>(ItemSchema.IsToDoItem, false);
            }
            OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromString(this.dataSource.ContainerId);

            CategorySwatch.RenderViewCategorySwatches(writer, this.userContext, itemProperty, isToDoItem, itemProperty2, itemColorInt, folderId);
            writer.Write("</div>");
        }
        // Token: 0x060021E8 RID: 8680 RVA: 0x000C18B0 File Offset: 0x000BFAB0
        protected override void LoadViewState()
        {
            OwaStoreObjectId owaStoreObjectId = null;

            if (base.SerializedContainerId != null)
            {
                if (OwaStoreObjectId.IsDummyArchiveFolder(base.SerializedContainerId))
                {
                    owaStoreObjectId         = base.UserContext.GetArchiveRootFolderId();
                    this.archiveRootFolderId = owaStoreObjectId.ToString();
                }
                else
                {
                    owaStoreObjectId = OwaStoreObjectId.CreateFromString(base.SerializedContainerId);
                }
            }
            if (owaStoreObjectId == null)
            {
                base.AlgorithmTracer.TraceDebug((long)this.GetHashCode(), "folder Id is null, using default folder");
                owaStoreObjectId = OwaStoreObjectId.CreateFromMailboxFolderId(this.DefaultFolderId);
            }
            PropertyDefinition[] array = new PropertyDefinition[]
            {
                FolderSchema.DisplayName,
                FolderSchema.ItemCount,
                FolderSchema.UnreadCount,
                ViewStateProperties.ReadingPanePosition,
                ViewStateProperties.ViewWidth,
                ViewStateProperties.ViewHeight,
                ViewStateProperties.MultiLine,
                ViewStateProperties.SortColumn,
                ViewStateProperties.SortOrder,
                ViewStateProperties.ViewFilter,
                ViewStateProperties.FilteredViewLabel,
                FolderSchema.SearchFolderAllowAgeout,
                FolderSchema.IsOutlookSearchFolder,
                FolderSchema.AdminFolderFlags,
                FolderSchema.FolderQuota,
                FolderSchema.FolderSize,
                FolderSchema.ELCFolderComment,
                FolderSchema.ELCPolicyIds,
                FolderSchema.ExtendedFolderFlags,
                StoreObjectSchema.EffectiveRights,
                FolderSchema.OutlookSearchFolderClsId
            };
            this.folder = Utilities.GetFolderForContent <Folder>(base.UserContext, owaStoreObjectId, array);
            this.favoritesFilterParameter = Utilities.GetFavoritesFilterViewParameter(base.UserContext, this.Folder);
            if (this.folder is SearchFolder && this.favoritesFilterParameter != null && !this.favoritesFilterParameter.IsCurrentVersion)
            {
                this.favoritesFilterParameter.UpgradeFilter(this.folder as SearchFolder, array);
            }
            this.sortOrder           = this.DefaultSortOrder;
            this.sortedColumn        = this.DefaultSortedColumn;
            this.isMultiLine         = this.DefaultMultiLineSetting;
            this.readingPanePosition = this.DefaultReadingPanePosition;
            FolderViewStates folderViewStates = base.UserContext.GetFolderViewStates(this.folder);

            if (base.UserContext.IsWebPartRequest)
            {
                string          queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "view", false);
                WebPartListView webPartListView      = WebPartUtilities.LookUpWebPartView(this.folder.Id.ObjectId.ObjectType, this.folder.ClassName, queryStringParameter);
                if (webPartListView != null)
                {
                    if (webPartListView.ColumnId != null)
                    {
                        this.sortedColumn = (ColumnId)webPartListView.ColumnId.Value;
                    }
                    if (webPartListView.SortOrder != null)
                    {
                        this.sortOrder = (SortOrder)webPartListView.SortOrder.Value;
                    }
                    if (webPartListView.IsMultiLine != null)
                    {
                        this.isMultiLine = webPartListView.IsMultiLine.Value;
                    }
                }
            }
            else
            {
                this.viewWidth   = folderViewStates.ViewWidth;
                this.viewHeight  = folderViewStates.ViewHeight;
                this.sortOrder   = folderViewStates.GetSortOrder(this.DefaultSortOrder);
                this.isMultiLine = folderViewStates.GetMultiLine(this.DefaultMultiLineSetting);
                string sortColumn = folderViewStates.GetSortColumn(null);
                if (sortColumn != null)
                {
                    ColumnId columnId = ColumnIdParser.Parse(sortColumn);
                    if (columnId < ColumnId.Count && (!this.isMultiLine || ListViewColumns.GetColumn(columnId).SortBoundaries != null))
                    {
                        this.sortedColumn = columnId;
                    }
                }
            }
            if (ConversationUtilities.IsConversationSortColumn(this.sortedColumn) && !ConversationUtilities.ShouldAllowConversationView(base.UserContext, this.Folder))
            {
                this.sortedColumn = ColumnId.DeliveryTime;
            }
            this.readingPanePosition = folderViewStates.GetReadingPanePosition(this.DefaultReadingPanePosition);
            this.LoadELCData();
        }
Esempio n. 18
0
        public static void GetFolders(UserContext userContext, out OwaStoreObjectId[] folderIds, out string[] folderNames, out string[] folderClassNames, out int folderCount)
        {
            folderIds        = new OwaStoreObjectId[10];
            folderNames      = new string[10];
            folderClassNames = new string[10];
            folderCount      = 0;
            SimpleConfiguration <TargetFolderMRUEntry> simpleConfiguration = new SimpleConfiguration <TargetFolderMRUEntry>(userContext);

            simpleConfiguration.Load();
            bool flag = false;
            int  i    = 0;

            while (i < simpleConfiguration.Entries.Count)
            {
                if (i >= 10)
                {
                    break;
                }
                OwaStoreObjectId owaStoreObjectId = null;
                try
                {
                    owaStoreObjectId = OwaStoreObjectId.CreateFromString(simpleConfiguration.Entries[i].FolderId);
                }
                catch (OwaInvalidIdFormatException)
                {
                    simpleConfiguration.Entries.RemoveAt(i);
                    flag = true;
                    continue;
                }
                if (!userContext.IsPublicFoldersAvailable() && owaStoreObjectId.IsPublic)
                {
                    i++;
                }
                else
                {
                    Folder folder = null;
                    string text   = null;
                    string text2  = null;
                    try
                    {
                        folder = Utilities.GetFolder <Folder>(userContext, owaStoreObjectId, new PropertyDefinition[0]);
                        if (Utilities.IsFolderSegmentedOut(folder.ClassName, userContext))
                        {
                            i++;
                            continue;
                        }
                        text2 = folder.ClassName;
                        text  = Utilities.GetDisplayNameByFolder(folder, userContext);
                    }
                    catch (ObjectNotFoundException)
                    {
                        simpleConfiguration.Entries.RemoveAt(i);
                        flag = true;
                        continue;
                    }
                    catch (StorageTransientException)
                    {
                        i++;
                        continue;
                    }
                    finally
                    {
                        if (folder != null)
                        {
                            folder.Dispose();
                            folder = null;
                        }
                    }
                    folderIds[folderCount]        = owaStoreObjectId;
                    folderNames[folderCount]      = text;
                    folderClassNames[folderCount] = text2;
                    folderCount++;
                    i++;
                }
            }
            while (simpleConfiguration.Entries.Count > 10)
            {
                simpleConfiguration.Entries.RemoveAt(10);
                flag = true;
            }
            if (flag)
            {
                simpleConfiguration.Save();
            }
        }
Esempio n. 19
0
        // Token: 0x060029FE RID: 10750 RVA: 0x000EB600 File Offset: 0x000E9800
        protected override void OnLoad(EventArgs e)
        {
            string queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "vt", false);
            int    num = 1;

            if (!string.IsNullOrEmpty(queryStringParameter) && (!int.TryParse(queryStringParameter, out num) || num < 1 || num >= 7))
            {
                throw new OwaInvalidRequestException("View type error");
            }
            this.viewType = (CalendarViewType)num;
            string queryStringParameter2 = Utilities.GetQueryStringParameter(base.Request, "wo", false);

            if (queryStringParameter2 == "1" || this.viewType == CalendarViewType.WorkWeek)
            {
                this.workingDayOnly = true;
            }
            this.days = Utilities.GetQueryStringParameterDateTimeArray(base.Request, "d", base.SessionContext.TimeZone, false, 7);
            if (this.days == null || this.days.Length == 0)
            {
                this.days = new ExDateTime[]
                {
                    ExDateTime.Now.Date
                };
            }
            string queryStringParameter3 = Utilities.GetQueryStringParameter(base.Request, "st", false);
            string queryStringParameter4 = Utilities.GetQueryStringParameter(base.Request, "et", false);

            if (!string.IsNullOrEmpty(queryStringParameter3))
            {
                int.TryParse(queryStringParameter3, out this.startTime);
            }
            if (!string.IsNullOrEmpty(queryStringParameter4))
            {
                int.TryParse(queryStringParameter4, out this.endTime);
            }
            if (this.startTime >= this.endTime || this.startTime < 0 || this.endTime > 24)
            {
                throw new OwaInvalidRequestException("start time and end time must be in range and start time must early than end time");
            }
            if (this.workingDayOnly)
            {
                if (this.viewType == CalendarViewType.Weekly)
                {
                    this.viewType = CalendarViewType.WorkWeek;
                }
                else if (this.viewType == CalendarViewType.WeeklyAgenda)
                {
                    this.viewType = CalendarViewType.WorkWeeklyAgenda;
                }
            }
            if (this.viewType == CalendarViewType.Min)
            {
                string queryStringParameter5 = Utilities.GetQueryStringParameter(base.Request, "rn", false);
                if (queryStringParameter5 == "1")
                {
                    this.renderNotes = true;
                }
            }
            string queryStringParameter6 = Utilities.GetQueryStringParameter(base.Request, "el", false);

            if (!string.IsNullOrEmpty(queryStringParameter6) && queryStringParameter6 == "1")
            {
                this.printEventList = true;
            }
            string queryStringParameter7 = Utilities.GetQueryStringParameter(base.Request, "id", false);

            if (base.SessionContext is AnonymousSessionContext)
            {
                PublishedCalendarAdapter publishedCalendarAdapter = new PublishedCalendarAdapter((AnonymousSessionContext)base.SessionContext);
                publishedCalendarAdapter.LoadData(CalendarUtilities.QueryProperties, this.days, this.startTime, this.endTime, this.viewType);
                this.calendarAdapter = publishedCalendarAdapter;
            }
            else
            {
                OwaStoreObjectId owaStoreObjectId;
                if (queryStringParameter7 != null)
                {
                    owaStoreObjectId = OwaStoreObjectId.CreateFromString(queryStringParameter7);
                }
                else
                {
                    ExTraceGlobals.CalendarTracer.TraceDebug(0L, "folder Id is null, using default folder");
                    owaStoreObjectId = base.UserContext.CalendarFolderOwaId;
                }
                if (owaStoreObjectId == null)
                {
                    throw new OwaInvalidRequestException("Invalid folder id");
                }
                CalendarAdapter calendarAdapter = new CalendarAdapter(base.UserContext, owaStoreObjectId);
                calendarAdapter.LoadData(this.printEventList ? CalendarUtilities.PrintQueryProperties : CalendarUtilities.QueryProperties, this.days, false, this.startTime, this.endTime, ref this.viewType, out this.viewWidth, out this.readingPanePosition);
                this.calendarAdapter = calendarAdapter;
            }
            if (!this.calendarAdapter.UserCanReadItem)
            {
                return;
            }
            base.OnLoad(e);
        }
Esempio n. 20
0
        // Token: 0x0600227F RID: 8831 RVA: 0x000C5028 File Offset: 0x000C3228
        public static FolderVirtualListViewFilter ParseFromPropertyValue(object propertyValue)
        {
            string[] array = propertyValue as string[];
            if (array == null || array.Length < 2)
            {
                return(null);
            }
            if (string.IsNullOrEmpty(array[0]))
            {
                return(null);
            }
            FolderVirtualListViewFilter folderVirtualListViewFilter = new FolderVirtualListViewFilter();

            try
            {
                folderVirtualListViewFilter.SourceFolderId = OwaStoreObjectId.CreateFromString(array[0]);
            }
            catch (OwaInvalidIdFormatException)
            {
                return(null);
            }
            int num = 0;

            folderVirtualListViewFilter.version = 0;
            if (!string.IsNullOrEmpty(array[1]))
            {
                string[] array2 = array[1].Split(new char[]
                {
                    ':'
                });
                if (array2.Length < 1 || !int.TryParse(array2[0], out num))
                {
                    num = 0;
                }
                if (array2.Length < 2 || !int.TryParse(array2[1], out folderVirtualListViewFilter.version))
                {
                    folderVirtualListViewFilter.version = 0;
                }
            }
            folderVirtualListViewFilter.SendToMe         = ((num & 1) != 0);
            folderVirtualListViewFilter.CcToMe           = ((num & 2) != 0);
            folderVirtualListViewFilter.IsUnread         = ((num & 4) != 0);
            folderVirtualListViewFilter.IsHighImportance = ((num & 16) != 0);
            folderVirtualListViewFilter.HasAttachments   = ((num & 32) != 0);
            folderVirtualListViewFilter.IsFlag           = ((num & 8) != 0);
            int           num2          = 0;
            StringBuilder stringBuilder = new StringBuilder();
            bool          flag          = true;

            for (int i = 2; i < array.Length; i++)
            {
                if (!string.IsNullOrEmpty(array[i]))
                {
                    if (array[i].StartsWith(";"))
                    {
                        if (num2 == 3 && string.IsNullOrEmpty(folderVirtualListViewFilter.Categories))
                        {
                            folderVirtualListViewFilter.Categories = stringBuilder.ToString();
                        }
                        string value = array[i].Substring(";".Length);
                        if ("sTo".Equals(value, StringComparison.OrdinalIgnoreCase))
                        {
                            num2 = 1;
                        }
                        else if ("sFrm".Equals(value, StringComparison.OrdinalIgnoreCase))
                        {
                            num2 = 2;
                        }
                        else if ("sCat".Equals(value, StringComparison.OrdinalIgnoreCase))
                        {
                            num2 = 3;
                        }
                        else
                        {
                            num2 = 0;
                        }
                    }
                    else
                    {
                        switch (num2)
                        {
                        case 1:
                            if (string.IsNullOrEmpty(folderVirtualListViewFilter.To))
                            {
                                folderVirtualListViewFilter.To = array[i];
                            }
                            break;

                        case 2:
                            if (string.IsNullOrEmpty(folderVirtualListViewFilter.From))
                            {
                                folderVirtualListViewFilter.From = array[i];
                            }
                            break;

                        case 3:
                            if (!flag)
                            {
                                stringBuilder.Append(',');
                            }
                            flag = false;
                            stringBuilder.Append(array[i]);
                            break;
                        }
                    }
                }
            }
            if (num2 == 3 && string.IsNullOrEmpty(folderVirtualListViewFilter.Categories))
            {
                folderVirtualListViewFilter.Categories = stringBuilder.ToString();
            }
            return(folderVirtualListViewFilter);
        }
        // Token: 0x06002740 RID: 10048 RVA: 0x000DFB70 File Offset: 0x000DDD70
        protected override void OnLoad(EventArgs e)
        {
            ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, "CalendarView.OnLoad");
            this.Infobar = new Infobar();
            this.readingPaneMarkupBegin = SanitizedHtmlString.Format("{0}{1}{2}", new object[]
            {
                "<iframe allowtransparency id=\"ifCalRP\" frameborder=\"0\" src=\"",
                base.UserContext.GetBlankPage(),
                "\""
            });
            string           queryStringParameter = Utilities.GetQueryStringParameter(base.Request, "id", false);
            OwaStoreObjectId owaStoreObjectId;

            if (queryStringParameter != null)
            {
                owaStoreObjectId = OwaStoreObjectId.CreateFromString(queryStringParameter);
            }
            else
            {
                ExTraceGlobals.CalendarTracer.TraceDebug(0L, "folder Id is null, using default folder");
                owaStoreObjectId = base.UserContext.CalendarFolderOwaId;
            }
            if (owaStoreObjectId == null)
            {
                throw new OwaInvalidRequestException("Invalid folder id");
            }
            string queryStringParameter2 = Utilities.GetQueryStringParameter(base.Request, "d", false);

            ExDateTime[] days = null;
            if (queryStringParameter2 != null)
            {
                try
                {
                    days = new ExDateTime[]
                    {
                        DateTimeUtilities.ParseIsoDate(queryStringParameter2, base.UserContext.TimeZone).Date
                    };
                }
                catch (OwaParsingErrorException)
                {
                    ExTraceGlobals.CalendarTracer.TraceDebug <string>(0L, "Invalid date provided on URL '{0}'", queryStringParameter2);
                    throw new OwaInvalidRequestException("Invalid date on URL");
                }
            }
            if (base.UserContext.IsWebPartRequest)
            {
                string text = Utilities.GetQueryStringParameter(base.Request, "view", false);
                if (string.IsNullOrEmpty(text))
                {
                    text = WebPartUtilities.GetDefaultView("IPF.Appointment");
                }
                if (string.Equals(text, "daily", StringComparison.OrdinalIgnoreCase))
                {
                    this.viewType = CalendarViewType.Min;
                }
                else if (string.CompareOrdinal(text, "monthly") == 0)
                {
                    this.viewType = CalendarViewType.Monthly;
                }
                else
                {
                    this.viewType = CalendarViewType.Weekly;
                }
            }
            this.calendarAdapter = new CalendarAdapter(base.UserContext, owaStoreObjectId);
            this.calendarAdapter.LoadData(CalendarUtilities.QueryProperties, days, true, ref this.viewType, out this.viewWidth, out this.readingPanePosition);
            if (!this.calendarAdapter.UserCanReadItem)
            {
                return;
            }
            owaStoreObjectId = this.calendarAdapter.FolderId;
            using (CalendarAdapter calendarAdapter = new CalendarAdapter(base.UserContext, owaStoreObjectId))
            {
                if (this.viewType == CalendarViewType.Monthly)
                {
                    this.contentView = new CalendarView.ContentView(new DailyView(base.UserContext, calendarAdapter), new MonthlyView(base.UserContext, this.calendarAdapter), false);
                }
                else
                {
                    this.contentView = new CalendarView.ContentView(new DailyView(base.UserContext, this.calendarAdapter), new MonthlyView(base.UserContext, calendarAdapter), true);
                }
            }
            if (this.viewType != CalendarViewType.Monthly)
            {
                string queryStringParameter3 = Utilities.GetQueryStringParameter(base.Request, "srp", false);
                int    num;
                if (!string.IsNullOrEmpty(queryStringParameter3) && int.TryParse(queryStringParameter3, out num))
                {
                    this.readingPanePosition        = ((num != 0) ? ReadingPanePosition.Right : ReadingPanePosition.Off);
                    this.requestReadingPanePosition = this.readingPanePosition;
                }
            }
            else
            {
                this.readingPanePosition = ReadingPanePosition.Off;
            }
            string queryStringParameter4 = Utilities.GetQueryStringParameter(base.Request, "sid", false);

            if (queryStringParameter4 != null)
            {
                OwaStoreObjectId selectedItemId = OwaStoreObjectId.CreateFromString(queryStringParameter4);
                this.contentView.MainView.SelectedItemId = selectedItemId;
            }
            OwaSingleCounters.CalendarViewsLoaded.Increment();
            base.OnLoad(e);
        }