Ejemplo n.º 1
0
 private void MoveAlbum(IAlbum albumToMove)
 {
     try
     {
         GalleryObjectController.MoveGalleryObject(albumToMove, this.DestinationAlbum);
     }
     catch (System.IO.IOException ex)
     {
         throw new GalleryServerPro.ErrorHandler.CustomExceptions.CannotMoveDirectoryException(String.Format(CultureInfo.CurrentCulture, "Error while trying to move album {0}.", albumToMove.Id), ex);
     }
 }
Ejemplo n.º 2
0
        // Note: Use the following version of UpdateRoleSecurityForCopiedAlbum to enforce the rule that copied albums
        // must retain all role permissions it had in its original location, even inherited ones. This would go in
        // the Album class and be invoked from the CopyTo method.
        ///// <summary>
        ///// Validate that the copied album includes the same role permissions as the source album. If a role is
        ///// already applied at the destination album, then there is no need to specify it twice, so just let the
        ///// copied album inherit from its parent. This method does not remove any role permissions from the copied
        ///// album; it only ensures that the copied album includes the role permissions as the original album. It
        ///// may end up with additional permissions that are inherited through the copied album's parent.
        ///// </summary>
        ///// <param name="sourceAlbumId">The ID of the album the copy was made from.</param>
        ///// <param name="copiedAlbum">The album that was just copied.</param>
        //private void UpdateRoleSecurityForCopiedAlbum(int sourceAlbumId, IGalleryObject copiedAlbum)
        //{
        //  foreach (IGalleryServerRole role in this.GetGalleryServerRoles())
        //  {
        //    if (role.AllAlbumIds.Contains(sourceAlbumId))
        //    {
        //      // This role applies to the original album. Apply it to the copied album also, unless it will already inherit
        //      // this role from the destination album.
        //      if (!role.AllAlbumIds.Contains(this.DestinationAlbum.Id))
        //      {
        //        role.RootAlbumIds.Add(copiedAlbum.Id);
        //        role.Save();
        //      }
        //    }
        //  }
        //}

        private void MoveMediaObject(IGalleryObject mediaObjectToMove)
        {
            GalleryObjectController.MoveGalleryObject(mediaObjectToMove, this.DestinationAlbum);
        }