|
|
|
@ -614,26 +614,6 @@ namespace Avalonia.Controls.Primitives |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a range of items from an IEnumerable.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="items">The items.</param>
|
|
|
|
/// <param name="first">The index of the first item.</param>
|
|
|
|
/// <param name="last">The index of the last item.</param>
|
|
|
|
/// <returns>The items.</returns>
|
|
|
|
private static IEnumerable<object> GetRange(IEnumerable items, int first, int last) |
|
|
|
{ |
|
|
|
var list = (items as IList) ?? items.Cast<object>().ToList(); |
|
|
|
int step = first > last ? -1 : 1; |
|
|
|
|
|
|
|
for (int i = first; i != last; i += step) |
|
|
|
{ |
|
|
|
yield return list[i]; |
|
|
|
} |
|
|
|
|
|
|
|
yield return list[last]; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Makes a list of objects equal another.
|
|
|
|
/// </summary>
|
|
|
|
@ -666,6 +646,26 @@ namespace Avalonia.Controls.Primitives |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Gets a range of items from an IEnumerable.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="items">The items.</param>
|
|
|
|
/// <param name="first">The index of the first item.</param>
|
|
|
|
/// <param name="last">The index of the last item.</param>
|
|
|
|
/// <returns>The items.</returns>
|
|
|
|
private static IEnumerable<object> GetRange(IEnumerable items, int first, int last) |
|
|
|
{ |
|
|
|
var list = (items as IList) ?? items.Cast<object>().ToList(); |
|
|
|
int step = first > last ? -1 : 1; |
|
|
|
|
|
|
|
for (int i = first; i != last; i += step) |
|
|
|
{ |
|
|
|
yield return list[i]; |
|
|
|
} |
|
|
|
|
|
|
|
yield return list[last]; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Called when a container raises the <see cref="IsSelectedChangedEvent"/>.
|
|
|
|
/// </summary>
|
|
|
|
|