Ejemplo n.º 1
0
        /// <summary>
        /// Builds an ItemOperations request to empty a folder of all its items
        /// by using the specified collectionId and options
        /// In general, returns the XML formatted ItemOperations request as follows:
        /// <!--
        /// <?xml version="1.0" encoding="utf-8"?>
        /// <ItemOperations xmlns="ItemOperations" xmlns:airsync="AirSync" xmlns:airsyncbase="AirSyncBase">
        ///    <EmptyFolderContents>
        ///       <airsync:CollectionId>5</airsync:CollectionId>
        ///       <Options>
        ///          <DeleteSubFolders ></DeleteSubFolders >
        ///       </Options>
        ///    </EmptyFolderContents>
        /// </ItemOperations>
        /// -->
        /// </summary>
        /// <param name="collectionId">Specify the folder to be emptied, which can be returned by ActiveSync FolderSync command(Refer to [MS-ASCMD]2.2.3.30.2)</param>
        /// <returns>Returns the ItemOperationsRequest instance</returns>
        internal static ItemOperationsRequest CreateItemOperationsEmptyFolderContentsRequest(string collectionId)
        {
            Request.ItemOperationsEmptyFolderContents emptyFolderContents = new Request.ItemOperationsEmptyFolderContents
            {
                CollectionId = collectionId,
                Options      = new Request.ItemOperationsEmptyFolderContentsOptions {
                    DeleteSubFolders = string.Empty
                }
            };

            return(Common.CreateItemOperationsRequest(new object[] { emptyFolderContents }));
        }
        /// <summary>
        /// Builds an ItemOperations request to empty a folder of all its items
        /// by using the specified collectionId and options
        /// In general, returns the XML formatted ItemOperations request as follows:
        /// <!--
        /// <?xml version="1.0" encoding="utf-8"?>
        /// <ItemOperations xmlns="ItemOperations" xmlns:airsync="AirSync" xmlns:airsyncbase="AirSyncBase">
        ///    <EmptyFolderContents>
        ///       <airsync:CollectionId>5</airsync:CollectionId>
        ///       <Options>
        ///          <DeleteSubFolders ></DeleteSubFolders >
        ///       </Options>
        ///    </EmptyFolderContents>
        /// </ItemOperations>
        /// -->
        /// </summary>
        /// <param name="collectionId">Specify the folder to be emptied, which can be returned by ActiveSync FolderSync command(Refer to [MS-ASCMD]2.2.3.30.2)</param>
        /// <returns>Returns the ItemOperationsRequest instance</returns>
        internal static ItemOperationsRequest CreateItemOperationsEmptyFolderContentsRequest(string collectionId)
        {
            Request.ItemOperationsEmptyFolderContents emptyFolderContents = new Request.ItemOperationsEmptyFolderContents
            {
                CollectionId = collectionId,
                Options = new Request.ItemOperationsEmptyFolderContentsOptions { DeleteSubFolders = string.Empty }
            };

            return Common.CreateItemOperationsRequest(new object[] { emptyFolderContents });
        }