Exemplo n.º 1
0
        /* ----------------------------------------------------------------- */
        ///
        /// Rotate
        ///
        /// <summary>
        /// Rotates the selected images and regenerates them.
        /// </summary>
        ///
        /// <param name="src">Source collection.</param>
        /// <param name="degree">Rotation angle in degree unit.</param>
        ///
        /// <returns>
        /// History item to execute undo and redo actions.
        /// </returns>
        ///
        /* ----------------------------------------------------------------- */
        public static HistoryItem Rotate(this ImageCollection src, int degree)
        {
            var indices = src.GetSelectedIndices();

            return(HistoryItem.Invoke(
                       () => src.Rotate(indices, degree),
                       () => src.Rotate(indices, -degree)
                       ));
        }
Exemplo n.º 2
0
        /* ----------------------------------------------------------------- */
        ///
        /// Move
        ///
        /// <summary>
        /// Moves the selected images at the specified distance.
        /// </summary>
        ///
        /// <param name="src">Source collection.</param>
        /// <param name="delta">Moving distance.</param>
        ///
        /// <returns>
        /// History item to execute undo and redo actions.
        /// </returns>
        ///
        /* ----------------------------------------------------------------- */
        public static HistoryItem Move(this ImageCollection src, int delta)
        {
            var indices = src.GetSelectedIndices();
            var cvt     = indices.Select(i => i + delta).ToList();

            return(HistoryItem.Invoke(
                       () => src.Move(indices, delta),
                       () => src.Move(cvt, -delta)
                       ));
        }
Exemplo n.º 3
0
 /* ----------------------------------------------------------------- */
 ///
 /// Remove
 ///
 /// <summary>
 /// Removes the selected images.
 /// </summary>
 ///
 /// <param name="src">Source collection.</param>
 ///
 /// <returns>
 /// History item to execute undo and redo actions.
 /// </returns>
 ///
 /* ----------------------------------------------------------------- */
 public static HistoryItem Remove(this ImageCollection src) =>
 src.RemoveAt(src.GetSelectedIndices());