/* ----------------------------------------------------------------- */ /// /// InsertOrMove /// /// <summary> /// Inserts or moves the specified pages according to the specified /// condition. /// </summary> /// /// <param name="src">Source object.</param> /// <param name="obj">Drag&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); } }
/* ----------------------------------------------------------------- */ /// /// 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);