internal static void AddNonMailFolderToSharedFoldersGroup(UserContext userContext, Folder folder, NavigationNodeGroupSection groupSection) { if (groupSection == NavigationNodeGroupSection.Mail) { throw new ArgumentOutOfRangeException("Cannot add mail folder to shared folder group"); } NavigationNodeCollection navigationNodeCollection = NavigationNodeCollection.TryCreateNavigationNodeCollection(userContext, userContext.MailboxSession, groupSection); if (navigationNodeCollection.FindFoldersById(folder.Id.ObjectId).Length == 0) { navigationNodeCollection.AddFolderToDefaultGroup(userContext, NavigationNodeGroupType.SharedFoldersGroup, folder, true); navigationNodeCollection.Save(userContext.MailboxSession); } }
// Token: 0x0600078B RID: 1931 RVA: 0x0003964C File Offset: 0x0003784C public static int GetCalendarFolderColor(UserContext userContext, StoreObjectId calendarFolderId, NavigationNodeCollection navigationNodeCollection) { CalendarColorManager.ThrowIfCannotActAsOwner(userContext); if (userContext == null) { throw new ArgumentNullException("userContext"); } if (calendarFolderId == null) { throw new ArgumentNullException("calendarFolderId"); } int result = -2; if (navigationNodeCollection != null) { try { NavigationNodeFolder[] navigationNodeFolders = navigationNodeCollection.FindFoldersById(calendarFolderId); result = CalendarColorManager.GetCalendarFolderColor(userContext, navigationNodeCollection, navigationNodeFolders); } catch (StoragePermanentException ex) { string message = string.Format(CultureInfo.InvariantCulture, "CalendarColorManager.GetCalendarFolderColor. Unable to get calendar folder color. Exception: {0}.", new object[] { ex.Message }); ExTraceGlobals.CoreCallTracer.TraceDebug(0L, message); } catch (StorageTransientException ex2) { string message2 = string.Format(CultureInfo.InvariantCulture, "CalendarColorManager.GetCalendarFolderColor. Unable to get calendar folder color. Exception: {0}.", new object[] { ex2.Message }); ExTraceGlobals.CoreCallTracer.TraceDebug(0L, message2); } } return(result); }