// Token: 0x06002087 RID: 8327 RVA: 0x000BC88C File Offset: 0x000BAA8C
        public new string GetItemId()
        {
            VersionedId itemProperty = this.GetItemProperty <VersionedId>(FolderSchema.Id);

            if (itemProperty != null)
            {
                return(OwaStoreObjectId.CreateFromMailboxFolderId(itemProperty.ObjectId).ToString());
            }
            itemProperty = this.GetItemProperty <VersionedId>(ItemSchema.Id);
            if (itemProperty != null)
            {
                return(Utilities.GetItemIdString(itemProperty.ObjectId, base.Folder));
            }
            return(null);
        }
Beispiel #2
0
        // Token: 0x06002C64 RID: 11364 RVA: 0x000F7538 File Offset: 0x000F5738
        private Item CreateImplicitDraftItemHelper(StoreObjectType itemType, OwaStoreObjectId folderId)
        {
            if (itemType < StoreObjectType.Message)
            {
                throw new OwaInvalidRequestException("Item type provided is for a folder type.");
            }
            if (folderId == null && itemType == StoreObjectType.Post)
            {
                folderId = OwaStoreObjectId.CreateFromMailboxFolderId(base.UserContext.TryGetMyDefaultFolderId(DefaultFolderType.Drafts));
            }
            Item item = Utilities.CreateImplicitDraftItem(itemType, folderId);

            item.Save(SaveMode.ResolveConflicts);
            item.Load();
            return(item);
        }
Beispiel #3
0
        public void SubscribeToInternetCalendar()
        {
            string iCalUrlString = (string)base.GetParameter("iCalUrl");

            try
            {
                SubscribeResultsWebCal subscribeResultsWebCal = WebCalendar.Subscribe(base.UserContext.MailboxSession, iCalUrlString, null);
                OwaStoreObjectId       newFolderId            = OwaStoreObjectId.CreateFromMailboxFolderId(subscribeResultsWebCal.LocalFolderId);
                NavigationHost.RenderFavoritesAndNavigationTrees(this.Writer, base.UserContext, newFolderId, new NavigationNodeGroupSection[]
                {
                    NavigationNodeGroupSection.Calendar
                });
            }
            catch (InvalidSharingDataException)
            {
                this.SanitizingWriter.Write("<div id=\"err\" _msg=\"badUri\"></div>");
            }
            catch (NotSupportedWithMailboxVersionException)
            {
                throw new OwaInvalidRequestException("Your account isn't set up to allow calendars to be added from the Internet.");
            }
        }
        public static void CreateFavoriteAndMailboxTreeAndGetBuddyListStatus(UserContext userContext, out NavigationTree favoritesTree, out MailboxFolderTree mailboxFolderTree, out MailboxFolderTree[] archiveFolderTrees, out bool expandBuddyList)
        {
            NavigationTree.NormalAndSearchFolderList   item;
            NavigationTree.NormalAndSearchFolderList[] array;
            NavigationTree.CreateNormalAndSearchFolderLists(userContext, true, true, out item, out array);
            NavigationNodeCollection navigationCollection        = NavigationNodeCollection.TryCreateNavigationNodeCollection(userContext, userContext.MailboxSession, NavigationNodeGroupSection.First);
            List <NavigationTree.NormalAndSearchFolderList> list = new List <NavigationTree.NormalAndSearchFolderList>(1 + array.Length);

            list.Add(item);
            list.AddRange(array);
            favoritesTree     = NavigationTree.CreateFavoriteTreeByFolderLists(userContext, navigationCollection, list.ToArray());
            mailboxFolderTree = MailboxFolderTree.CreateStartPageMailboxFolderTree(userContext, item.DeepHierarchyFolderList, item.SearchFolderList);
            StatusPersistTreeNodeType valueToTest = StatusPersistTreeNodeType.None;
            object folderProperty = item.DeepHierarchyFolderList.GetFolderProperty(userContext.GetRootFolderId(userContext.MailboxSession), ViewStateProperties.TreeNodeCollapseStatus);

            if (folderProperty is int)
            {
                valueToTest = (StatusPersistTreeNodeType)folderProperty;
            }
            expandBuddyList = !Utilities.IsFlagSet((int)valueToTest, 4);
            bool             flag     = !Utilities.IsFlagSet((int)valueToTest, 2);
            bool             flag2    = !Utilities.IsFlagSet((int)valueToTest, 1);
            OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromMailboxFolderId(userContext.InboxFolderId);

            if (!flag || flag2 || !favoritesTree.RootNode.SelectSpecifiedFolder(folderId))
            {
                mailboxFolderTree.RootNode.SelectSpecifiedFolder(folderId);
            }
            archiveFolderTrees = null;
            if (array.Length > 0)
            {
                List <MailboxFolderTree> list2 = new List <MailboxFolderTree>(array.Length);
                for (int i = 0; i < array.Length; i++)
                {
                    list2.Add(MailboxFolderTree.CreateStartPageArchiveMailboxFolderTree(userContext, array[i].DeepHierarchyFolderList, array[i].SearchFolderList));
                }
                archiveFolderTrees = list2.ToArray();
            }
        }
        // Token: 0x06002210 RID: 8720 RVA: 0x000C2794 File Offset: 0x000C0994
        internal static MailboxFolderTree CreateMailboxFolderTree(UserContext userContext, MailboxSession mailboxSession, FolderTreeRenderType renderType, bool selectInbox)
        {
            MailboxFolderTree mailboxFolderTree = new MailboxFolderTree(userContext, mailboxSession, FolderTreeNode.CreateMailboxFolderTreeRootNode(userContext, mailboxSession, renderType), renderType);

            mailboxFolderTree.RootNode.IsExpanded = true;
            FolderTreeNode rootNode = mailboxFolderTree.RootNode;

            rootNode.HighlightClassName += " trNdGpHdHl";
            if (selectInbox)
            {
                StoreObjectId    defaultFolderId = Utilities.GetDefaultFolderId(mailboxSession, DefaultFolderType.Inbox);
                OwaStoreObjectId folderId;
                if (userContext.IsMyMailbox(mailboxSession))
                {
                    folderId = OwaStoreObjectId.CreateFromMailboxFolderId(defaultFolderId);
                }
                else
                {
                    folderId = OwaStoreObjectId.CreateFromOtherUserMailboxFolderId(defaultFolderId, mailboxSession.MailboxOwnerLegacyDN);
                }
                mailboxFolderTree.RootNode.SelectSpecifiedFolder(folderId);
            }
            return(mailboxFolderTree);
        }
Beispiel #6
0
        public void AddSharedCalendar()
        {
            using (SharingMessageItem requestItem = base.GetRequestItem <SharingMessageItem>(new PropertyDefinition[0]))
            {
                if (requestItem == null || !requestItem.SharingMessageType.IsInvitationOrAcceptOfRequest || requestItem.SharedFolderType != DefaultFolderType.Calendar)
                {
                    throw new OwaInvalidRequestException("Not a calendar sharing message");
                }
                this.ValidateSharingAction(SharingAction.AddCalendar, requestItem);
                SubscribeResults subscribeResults = null;
                try
                {
                    subscribeResults = requestItem.SubscribeAndOpen();
                }
                catch (NotSupportedWithMailboxVersionException)
                {
                    throw new OwaInvalidRequestException("Your account isn't set up to allow calendars to be added from the Internet.");
                }
                catch (StoragePermanentException ex)
                {
                    string message = string.Format("Unable to subscribe shared calendar folder. Exception {0}", ex.Message);
                    ExTraceGlobals.CalendarCallTracer.TraceDebug(0L, message);
                    this.RenderSubscriptionError(ex);
                    return;
                }
                if (subscribeResults is SubscribeResultsInternal)
                {
                    SubscribeResultsInternal subscribeResultsInternal = (SubscribeResultsInternal)subscribeResults;
                    string            text = StoreEntryId.TryParseMailboxLegacyDN(subscribeResultsInternal.RemoteMailboxId);
                    ExchangePrincipal exchangePrincipal;
                    if (base.UserContext.DelegateSessionManager.TryGetExchangePrincipal(text, out exchangePrincipal))
                    {
                        try
                        {
                            if (requestItem.IsSharedFolderPrimary)
                            {
                                if (!string.Equals(text, base.UserContext.MailboxOwnerLegacyDN, StringComparison.OrdinalIgnoreCase))
                                {
                                    NavigationNodeCollection.AddGSCalendarToSharedFoldersGroup(base.UserContext, exchangePrincipal);
                                }
                            }
                            else
                            {
                                using (OwaStoreObjectIdSessionHandle owaStoreObjectIdSessionHandle = new OwaStoreObjectIdSessionHandle(exchangePrincipal, base.UserContext))
                                {
                                    OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, owaStoreObjectIdSessionHandle.Session, subscribeResultsInternal.RemoteFolderId);
                                    using (Folder folder = Utilities.GetFolder <Folder>(base.UserContext, folderId, FolderList.FolderTreeQueryProperties))
                                    {
                                        if (!Utilities.CanReadItemInFolder(folder))
                                        {
                                            this.RenderNotFoundResponse();
                                            return;
                                        }
                                        NavigationNodeCollection.AddNonMailFolderToSharedFoldersGroup(base.UserContext, folder, NavigationNodeGroupSection.Calendar);
                                    }
                                }
                            }
                            goto IL_1A2;
                        }
                        catch (OwaSharedFromOlderVersionException)
                        {
                            this.RenderSharedFromE12Response();
                            return;
                        }
                        catch (ObjectNotFoundException)
                        {
                            this.RenderNotFoundResponse();
                            return;
                        }
                    }
                    this.RenderNotFoundResponse();
                    return;
                }
                if (subscribeResults is SubscribeResultsExternal)
                {
                    OwaStoreObjectId folderId = OwaStoreObjectId.CreateFromMailboxFolderId(((SubscribeResultsExternal)subscribeResults).LocalFolderId);
                }
IL_1A2:
                this.RenderChangeKey(requestItem);
                ExDateTime now = ExDateTime.GetNow(base.UserContext.TimeZone);
                this.Writer.Write("<div id=\"subInfo\">");
                this.Writer.Write(SanitizedHtmlString.Format(LocalizedStrings.GetHtmlEncoded(388258761), new object[]
                {
                    now.ToString(base.UserContext.UserOptions.DateFormat),
                    now.ToString(base.UserContext.UserOptions.TimeFormat)
                }));
                this.Writer.Write("</div>");
                RenderingUtilities.RenderNavigationTreeDirtyFlag(this.Writer, base.UserContext, NavigationTreeDirtyFlag.Calendar, new NavigationModule[]
                {
                    NavigationModule.Calendar
                });
            }
        }
        // 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();
        }