/// <summary> /// Move a item into a new position relative to the current position in the <see cref="IPagedDataSet"/> /// </summary> /// <param name="dataSet">the dataset to move item</param> /// <param name="item">The item to move</param> /// <param name="offset">a new position relative to the current item position</param> /// <returns></returns> public static async Task MoveOffset(this IMovable movable, IPagedDataSet dataSet, object item, int offset) => await movable.Move(item, (await dataSet.GetDataSource()).FindIndex(item) + offset);
/// <summary> /// Move item to the last position in the <see cref="IPagedDataSet"/> /// </summary> /// <param name="dataSet">the dataset to move item</param> /// <param name="item">The item to move</param> /// <returns></returns> public static async Task MoveToLast(this IMovable movable, IPagedDataSet dataSet, object item) => await movable.Move(item, (await dataSet.GetDataSource()).Count() - 1);
/// <summary> /// Remove an item from the <see cref="IPagedDataSet"/> with the specified position /// </summary> /// <param name="dataSet">The dataset to modify</param> /// <param name="index">The position to remove</param> /// <returns></returns> public static async Task RemoveAt(this IRemovable removable, IPagedDataSet dataSet, int index) => await removable.Remove((await dataSet.GetDataSource()).ElementAtOrDefault(index));