Exemplo n.º 1
0
        public static FavoriteFolderEntry Bind(MailboxSession session, StoreId storeId)
        {
            Util.ThrowOnNullArgument(session, "session");
            Util.ThrowOnNullArgument(storeId, "storeId");
            FavoriteFolderEntry favoriteFolderEntry = ItemBuilder.ItemBind <FavoriteFolderEntry>(session, storeId, FavoriteFolderEntrySchema.Instance, null);

            favoriteFolderEntry.MailboxSession = session;
            return(favoriteFolderEntry);
        }
Exemplo n.º 2
0
        public static FavoriteFolderEntry Create(MailboxSession session, StoreObjectId folderId, FolderTreeDataType dataType, FavoriteFolderType favoriteFolderType)
        {
            Util.ThrowOnNullArgument(session, "session");
            Util.ThrowOnNullArgument(session, "folderId");
            EnumValidator.ThrowIfInvalid <FolderTreeDataType>(dataType, "dataType");
            EnumValidator.ThrowIfInvalid <FavoriteFolderType>(favoriteFolderType, "favoriteFolderType");
            FolderTreeDataSection groupSection = FavoriteFolderEntry.FavoritesGroupSectionByFolderType[favoriteFolderType];

            byte[] favoritesClassIdValue            = FavoriteFolderEntry.FavoritesClassIdValueByFolderType[favoriteFolderType];
            FavoriteFolderEntry favoriteFolderEntry = ItemBuilder.CreateNewItem <FavoriteFolderEntry>(session, session.GetDefaultFolderId(DefaultFolderType.CommonViews), ItemCreateInfo.FavoriteFolderEntryInfo, CreateMessageType.Associated);

            byte[] favoritesParentGroupClassIdValue           = (FavoriteFolderType.Contact == favoriteFolderType || FavoriteFolderType.Calendar == favoriteFolderType) ? NavigationNodeParentGroup.OtherFoldersClassId.AsBytes : null;
            FolderTreeDataFlags additionalFolderTreeDataFlags = FolderTreeDataFlags.None;

            if (folderId.IsLegacyPublicFolderType())
            {
                additionalFolderTreeDataFlags = FavoriteFolderEntry.PublicFolderTreeDataFlagsByFolderType[favoriteFolderType];
            }
            favoriteFolderEntry.SetPropertiesOfFavoriteFolderEntry(session, folderId, dataType, groupSection, favoritesClassIdValue, favoritesParentGroupClassIdValue, additionalFolderTreeDataFlags);
            return(favoriteFolderEntry);
        }
Exemplo n.º 3
0
 public static FavoriteFolderEntry Create(MailboxSession session, StoreObjectId folderId, FolderTreeDataType dataType)
 {
     return(FavoriteFolderEntry.Create(session, folderId, dataType, FavoriteFolderType.Mail));
 }