Exemplo n.º 1
0
        /* ----------------------------------------------------------------- */
        ///
        /// MoveNext
        ///
        /// <summary>
        /// Moves selected items accoding to the specified condition.
        /// </summary>
        ///
        /// <param name="src">Facade object.</param>
        /// <param name="obj">Drag&amp;Drop result.</param>
        ///
        /* ----------------------------------------------------------------- */
        private static void MoveNext(this MainFacade src, DragDropObject obj)
        {
            var delta = obj.DropIndex - obj.DragIndex;
            var n     = src.Bindable.Images.Selection.Indices
                        .Where(i => i > obj.DragIndex && i <= obj.DropIndex).Count();

            src.Move(delta - n);
        }
Exemplo n.º 2
0
 /* ----------------------------------------------------------------- */
 ///
 /// InsertOrMove
 ///
 /// <summary>
 /// Inserts or moves the specified pages accoding to the specified
 /// condition.
 /// </summary>
 ///
 /// <param name="src">Facade object.</param>
 /// <param name="obj">Drag&amp;Drop result.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void InsertOrMove(this MainFacade src, DragDropObject obj)
 {
     if (!obj.IsCurrentProcess)
     {
         var index = Math.Min(obj.DropIndex + 1, src.Bindable.Count.Value);
         src.Insert(index, obj.Pages);
     }
     else if (obj.DragIndex < obj.DropIndex)
     {
         src.MoveNext(obj);
     }
     else
     {
         src.MovePrevious(obj);
     }
 }