当前位置: 首页>>代码示例>>C#>>正文


C# IAlbum.DeleteFromGallery方法代码示例

本文整理汇总了C#中IAlbum.DeleteFromGallery方法的典型用法代码示例。如果您正苦于以下问题:C# IAlbum.DeleteFromGallery方法的具体用法?C# IAlbum.DeleteFromGallery怎么用?C# IAlbum.DeleteFromGallery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAlbum的用法示例。


在下文中一共展示了IAlbum.DeleteFromGallery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteAlbum

        /// <summary>
        /// Permanently delete this album from the data store and optionally the hard drive. Validation is performed prior to deletion to ensure
        /// current user has delete permission and the album can be safely deleted. The validation is contained in the method 
        /// <see cref="ValidateBeforeAlbumDelete"/> and may be invoked separately if desired.
        /// </summary>
        /// <param name="album">The album to delete. If null, the function returns without taking any action.</param>
        /// <param name="deleteFromFileSystem">if set to <c>true</c> the files and directories associated with the album
        /// are deleted from the hard disk. Set this to <c>false</c> to delete only the database records.</param>
        /// <exception cref="CannotDeleteAlbumException">Thrown when the album does not meet the requirements for safe deletion.
        /// This includes detecting when the media objects path is read only and when the album is or contains the user album
        /// parent album and user albums are enabled.</exception>
        /// <exception cref="GallerySecurityException">Thrown when the current user does not have permission to delete the album.</exception>
        public static void DeleteAlbum(IAlbum album, bool deleteFromFileSystem = true)
        {
            if (album == null)
                return;

            ValidateBeforeAlbumDelete(album);

            OnBeforeAlbumDelete(album);

            if (deleteFromFileSystem)
            {
                album.Delete();
            }
            else
            {
                album.DeleteFromGallery();
            }

            HelperFunctions.PurgeCache();
        }
开发者ID:Jiyuu,项目名称:galleryserverpro,代码行数:32,代码来源:AlbumController.cs


注:本文中的IAlbum.DeleteFromGallery方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。