Browse Source

Move SynchronizeItems about private methods.

pull/2347/head
Dariusz Komosinski 7 years ago
parent
commit
c9d8fa6a9d
  1. 40
      src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

40
src/Avalonia.Controls/Primitives/SelectingItemsControl.cs

@ -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>

Loading…
Cancel
Save