Esempio n. 1
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);
     }
 }
Esempio 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);