Exemplo n.º 1
0
        public static AggregateOperationResult DeleteOutlookSearchFolder(DeleteItemFlags deleteItemFlags, MailboxSession session, StoreId outlookSearchFolderId)
        {
            EnumValidator.ThrowIfInvalid <DeleteItemFlags>(deleteItemFlags);
            VersionedId versionedId;

            using (OutlookSearchFolder outlookSearchFolder = OutlookSearchFolder.Bind(session, outlookSearchFolderId))
            {
                versionedId = OutlookSearchFolder.FindAssociatedMessageId((MailboxSession)outlookSearchFolder.Session, (Guid)outlookSearchFolder[InternalSchema.OutlookSearchFolderClsId]);
            }
            StoreId[] ids;
            if (versionedId != null)
            {
                ids = new StoreId[]
                {
                    outlookSearchFolderId,
                    versionedId
                };
            }
            else
            {
                ids = new StoreId[]
                {
                    outlookSearchFolderId
                };
            }
            return(session.Delete(deleteItemFlags, ids));
        }
Exemplo n.º 2
0
        public new static OutlookSearchFolder Bind(MailboxSession session, DefaultFolderType defaultFolderType, ICollection <PropertyDefinition> propsToReturn)
        {
            EnumValidator.ThrowIfInvalid <DefaultFolderType>(defaultFolderType, "defaultFolderType");
            DefaultFolder defaultFolder = session.InternalGetDefaultFolder(defaultFolderType);

            if (defaultFolder.StoreObjectType != StoreObjectType.OutlookSearchFolder)
            {
                throw new ArgumentOutOfRangeException("defaultFolderType");
            }
            return(OutlookSearchFolder.Bind(session, session.SafeGetDefaultFolderId(defaultFolderType), propsToReturn));
        }
Exemplo n.º 3
0
 public new static OutlookSearchFolder Bind(MailboxSession session, DefaultFolderType defaultFolderType)
 {
     return(OutlookSearchFolder.Bind(session, defaultFolderType, null));
 }
Exemplo n.º 4
0
 public new static OutlookSearchFolder Bind(StoreSession session, StoreId folderId)
 {
     return(OutlookSearchFolder.Bind(session, folderId, null));
 }