Ejemplo n.º 1
0
 /* ----------------------------------------------------------------- */
 ///
 /// InsertOrMove
 ///
 /// <summary>
 /// Inserts or moves the specified pages according to the specified
 /// condition.
 /// </summary>
 ///
 /// <param name="src">Source 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.Value.Count);
         src.Insert(index, obj.Pages);
     }
     else if (obj.DragIndex < obj.DropIndex)
     {
         src.MoveNext(obj);
     }
     else
     {
         src.MovePrevious(obj);
     }
 }
Ejemplo n.º 2
0
 /* ----------------------------------------------------------------- */
 ///
 /// Insert
 ///
 /// <summary>
 /// Inserts the specified file behind the selected index.
 /// </summary>
 ///
 /// <param name="src">Facade object.</param>
 /// <param name="files">Collection of inserting files.</param>
 ///
 /* ----------------------------------------------------------------- */
 public static void Insert(this MainFacade src, IEnumerable <string> files) =>
 src.Insert(src.Bindable.Images.Selection.Last + 1, files);