private void GetDataAndUpdateCommonViewIfNecessary(bool needGetColor) { NavigationNodeCollection navigationNodeCollection = null; NavigationNodeFolder[] array = null; if (Utilities.IsWebPartDelegateAccessRequest(OwaContext.Current) || (!needGetColor && this.FolderId.Equals(this.UserContext.CalendarFolderOwaId)) || !this.TryGetNodeFoldersFromNavigationTree(out array, out navigationNodeCollection)) { base.CalendarTitle = ((this.folder != null) ? this.folder.DisplayName : string.Empty); this.CalendarColor = -2; return; } this.CalendarColor = CalendarColorManager.GetCalendarFolderColor(this.UserContext, navigationNodeCollection, array); OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromNavigationNodeFolder(this.UserContext, array[0]); if (owaStoreObjectId.IsArchive) { base.CalendarTitle = string.Format(LocalizedStrings.GetNonEncoded(-83764036), array[0].Subject, Utilities.GetMailboxOwnerDisplayName((MailboxSession)owaStoreObjectId.GetSession(this.UserContext))); } else { base.CalendarTitle = array[0].Subject; } foreach (NavigationNodeFolder navigationNodeFolder in array) { if (!navigationNodeFolder.IsGSCalendar && navigationNodeFolder.IsPrimarySharedCalendar) { navigationNodeFolder.UpgradeToGSCalendar(); } if (this.olderExchangeCalendarTypeInNode == NavigationNodeFolder.OlderExchangeCalendarType.Unknown) { this.olderExchangeCalendarTypeInNode = navigationNodeFolder.OlderExchangeSharedCalendarType; } } }
public void Rename() { base.ThrowIfCannotActAsOwner(); string text = ((string)base.GetParameter("SB")).Trim(); string s = text; NavigationNodeGroupSection navigationNodeGroupSection = (NavigationNodeGroupSection)base.GetParameter("GS"); NavigationNodeCollection navigationNodeCollection = NavigationNodeCollection.TryCreateNavigationNodeCollection(base.UserContext, base.UserContext.MailboxSession, navigationNodeGroupSection); NavigationNode navigationNode = navigationNodeCollection.FindNavigationNodeByNodeId((StoreObjectId)base.GetParameter("srcNId")); if (navigationNode == null) { throw new OwaEventHandlerException("Cannot find specified navigation node", LocalizedStrings.GetNonEncoded(-289549140), true); } if (text.Length != 0) { if (navigationNode is NavigationNodeFolder) { NavigationNodeFolder navigationNodeFolder = navigationNode as NavigationNodeFolder; if (!navigationNodeFolder.IsValid) { throw new OwaInvalidRequestException("This is not a valid navigation node"); } if (navigationNodeFolder.NavigationNodeType == NavigationNodeType.SmartFolder && !navigationNodeFolder.IsFilteredView) { throw new OwaInvalidRequestException("Cannot rename search folders"); } OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromNavigationNodeFolder(base.UserContext, navigationNodeFolder); MailboxSession mailboxSession = owaStoreObjectId.IsArchive ? ((MailboxSession)owaStoreObjectId.GetSession(base.UserContext)) : base.UserContext.MailboxSession; if (owaStoreObjectId.IsArchive && navigationNodeFolder.NavigationNodeType == NavigationNodeType.NormalFolder) { s = string.Format(LocalizedStrings.GetNonEncoded(-83764036), text, Utilities.GetMailboxOwnerDisplayName(mailboxSession)); } if (navigationNodeFolder.IsFolderInSpecificMailboxSession(mailboxSession)) { using (Folder folder = Folder.Bind(mailboxSession, navigationNodeFolder.FolderId, new PropertyDefinition[] { FolderSchema.ExtendedFolderFlags })) { if (!Utilities.CanFolderBeRenamed(base.UserContext, folder)) { throw new OwaInvalidRequestException("Folder cannot be renamed."); } folder.DisplayName = text; FolderSaveResult folderSaveResult = folder.Save(); if (folderSaveResult.OperationResult != OperationResult.Succeeded) { if (Utilities.IsFolderNameConflictError(folderSaveResult)) { throw new OwaEventHandlerException("Folder rename did not return OperationResult.Succeeded", LocalizedStrings.GetNonEncoded(1602494619), OwaEventHandlerErrorCode.FolderNameExists, true); } throw new OwaAccessDeniedException(LocalizedStrings.GetNonEncoded(995407892)); } } } } navigationNode.Subject = text; navigationNodeCollection.Save(base.UserContext.MailboxSession); this.Writer.Write("<div id=tn>"); Utilities.HtmlEncode(text, this.Writer, true); this.Writer.Write("</div><div id=ntn>"); Utilities.HtmlEncode(s, this.Writer, true); this.Writer.Write("</div>"); return; } if (navigationNode is NavigationNodeGroup) { throw new OwaEventHandlerException("User did not provide name for new group", LocalizedStrings.GetNonEncoded(-1749891264), true); } throw new OwaEventHandlerException("User did not provide name for new folder", LocalizedStrings.GetNonEncoded(-41080803), true); }
// Token: 0x0600241C RID: 9244 RVA: 0x000D070E File Offset: 0x000CE90E internal NavigationFolderTreeNode(UserContext userContext, NavigationNodeFolder nodeFolder, StoreObjectId elcPolicyFolderId, object[] values, Dictionary <PropertyDefinition, int> propertyMap) : base(userContext, OwaStoreObjectId.CreateFromNavigationNodeFolder(userContext, nodeFolder).GetSession(userContext), values, propertyMap) { if (nodeFolder.IsNew) { throw new ArgumentException("Should not use newly created node"); } this.navigationNodeFolder = nodeFolder; this.elcPolicyFolderId = elcPolicyFolderId; }
public void Remove() { base.ThrowIfCannotActAsOwner(); StoreObjectId nodeId = (StoreObjectId)base.GetParameter("srcNId"); NavigationNodeGroupSection navigationNodeGroupSection = (NavigationNodeGroupSection)base.GetParameter("GS"); NavigationNodeCollection navigationNodeCollection = NavigationNodeCollection.TryCreateNavigationNodeCollection(base.UserContext, base.UserContext.MailboxSession, navigationNodeGroupSection); List <OwaStoreObjectId> list = new List <OwaStoreObjectId>(); NavigationNode navigationNode = navigationNodeCollection.FindNavigationNodeByNodeId(nodeId); if (navigationNode == null) { base.RenderPartialFailure(-289549140, OwaEventHandlerErrorCode.NotSet); } else { OperationResult operationResult = (OperationResult)0; if (navigationNodeGroupSection != NavigationNodeGroupSection.First) { List <NavigationNodeFolder> list2 = new List <NavigationNodeFolder>(); if (navigationNode is NavigationNodeFolder) { list2.Add(navigationNode as NavigationNodeFolder); } else if (navigationNode is NavigationNodeGroup) { NavigationNodeGroup navigationNodeGroup = navigationNode as NavigationNodeGroup; foreach (NavigationNodeFolder item in navigationNodeGroup.Children) { list2.Add(item); } } foreach (NavigationNodeFolder navigationNodeFolder in list2) { if (navigationNodeFolder.IsValid) { OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromNavigationNodeFolder(base.UserContext, navigationNodeFolder); MailboxSession mailboxSession = owaStoreObjectId.IsArchive ? ((MailboxSession)owaStoreObjectId.GetSession(base.UserContext)) : base.UserContext.MailboxSession; if (navigationNodeFolder.IsFolderInSpecificMailboxSession(mailboxSession)) { if (Utilities.IsSpecialFolderForSession(mailboxSession, navigationNodeFolder.FolderId)) { throw new OwaEventHandlerException("Cannot delete default folders.", LocalizedStrings.GetNonEncoded(-1164567320), true); } if (operationResult == (OperationResult)0) { operationResult = OperationResult.Succeeded; } AggregateOperationResult aggregateOperationResult = mailboxSession.Delete(DeleteItemFlags.MoveToDeletedItems, new StoreId[] { navigationNodeFolder.FolderId }); if (aggregateOperationResult.OperationResult == OperationResult.Succeeded) { list.Add(OwaStoreObjectId.CreateFromNavigationNodeFolder(base.UserContext, navigationNodeFolder)); } else { operationResult = OperationResult.PartiallySucceeded; } } } } if (operationResult != (OperationResult)0 && list.Count == 0) { operationResult = OperationResult.Failed; } if (operationResult == OperationResult.Failed) { base.RenderPartialFailure(1041829989, OwaEventHandlerErrorCode.NotSet); } else if (operationResult == OperationResult.PartiallySucceeded) { base.RenderPartialFailure(995407892, OwaEventHandlerErrorCode.NotSet); } } else { NavigationNodeFolder navigationNodeFolder2 = navigationNode as NavigationNodeFolder; if (navigationNodeFolder2 != null && navigationNodeFolder2.IsFilteredView) { OwaStoreObjectId owaStoreObjectId2 = OwaStoreObjectId.CreateFromNavigationNodeFolder(base.UserContext, navigationNodeFolder2); using (SearchFolder searchFolder = SearchFolder.Bind(owaStoreObjectId2.GetSession(base.UserContext), owaStoreObjectId2.StoreObjectId, FolderList.FolderTreeQueryProperties)) { searchFolder[FolderSchema.SearchFolderAllowAgeout] = true; searchFolder.DisplayName = Utilities.GetRandomNameForTempFilteredView(base.UserContext); searchFolder.Save(); } } } if (operationResult == (OperationResult)0 || operationResult == OperationResult.Succeeded) { if (navigationNodeCollection.RemoveFolderOrGroupByNodeId(nodeId) != null) { navigationNodeCollection.Save(base.UserContext.MailboxSession); } } else if (operationResult == OperationResult.PartiallySucceeded) { foreach (OwaStoreObjectId owaStoreObjectId3 in list) { navigationNodeCollection.RemoveFolderByLegacyDNandId(owaStoreObjectId3.MailboxOwnerLegacyDN ?? base.UserContext.MailboxOwnerLegacyDN, owaStoreObjectId3.StoreObjectId); } navigationNodeCollection.Save(base.UserContext.MailboxSession); } } NavigationTreeDirtyFlag navigationTreeDirtyFlag = NavigationTreeDirtyFlag.None; if (navigationNodeGroupSection == NavigationNodeGroupSection.First) { navigationTreeDirtyFlag = NavigationTreeDirtyFlag.Favorites; } else { if (list.Count > 0) { List <FolderTreeNode> list3 = FolderTreeNode.CreateDeletedNodesWithDirtyCheck(base.UserContext, list, out navigationTreeDirtyFlag); this.Writer.Write("<div id=tn>"); foreach (FolderTreeNode folderTreeNode in list3) { folderTreeNode.RenderUndecoratedNode(this.Writer); } this.Writer.Write("</div>"); } switch (navigationNodeGroupSection) { case NavigationNodeGroupSection.Calendar: navigationTreeDirtyFlag |= NavigationTreeDirtyFlag.Calendar; break; case NavigationNodeGroupSection.Contacts: navigationTreeDirtyFlag |= NavigationTreeDirtyFlag.Contact; break; case NavigationNodeGroupSection.Tasks: navigationTreeDirtyFlag |= NavigationTreeDirtyFlag.Task; break; } } RenderingUtilities.RenderNavigationTreeDirtyFlag(this.Writer, base.UserContext, navigationTreeDirtyFlag, (NavigationModule[])base.GetParameter("cms")); }
// Token: 0x0600241B RID: 9243 RVA: 0x000D06B4 File Offset: 0x000CE8B4 internal NavigationFolderTreeNode(UserContext userContext, NavigationNodeFolder nodeFolder) : base(userContext, OwaStoreObjectId.CreateFromNavigationNodeFolder(userContext, nodeFolder), nodeFolder.Subject, nodeFolder.GetFolderClass(), nodeFolder.IsFlagSet(NavigationNodeFlags.TodoFolder) ? DefaultFolderType.ToDoSearch : DefaultFolderType.None) { if (nodeFolder.IsNew) { throw new ArgumentException("Should not use newly created node"); } this.navigationNodeFolder = nodeFolder; this.elcPolicyFolderId = null; }