Files
ZuneShell.dll/UIX/Microsoft/Iris/Group.cs
T

60 lines
1.9 KiB
C#
Raw Normal View History

// Decompiled with JetBrains decompiler
// Type: Microsoft.Iris.Group
// Assembly: UIX, Version=4.8.0.0, Culture=neutral, PublicKeyToken=ddd0da4d3e678217
// MVID: A56C6C9D-B7F6-46A9-8BDE-B3D9B8D60B11
// Assembly location: C:\Program Files\Zune\UIX.dll
using Microsoft.Iris.Data;
namespace Microsoft.Iris
{
public class Group : VirtualList
{
private GroupedList _groupedList;
private int _startIndex;
internal Group(GroupedList groupedList, int startIndex, int count)
2021-03-31 17:15:06 -05:00
: base(groupedList, true, null)
{
2021-04-02 19:10:51 -05:00
_groupedList = groupedList;
_startIndex = startIndex;
Count = count;
}
public int StartIndex
{
2021-04-02 19:10:51 -05:00
get => _startIndex;
internal set
{
2021-04-02 19:10:51 -05:00
if (_startIndex == value)
return;
2021-04-02 19:10:51 -05:00
_startIndex = value;
FirePropertyChanged(nameof(StartIndex));
FirePropertyChanged("EndIndex");
}
}
2021-04-02 19:10:51 -05:00
public int EndIndex => StartIndex + Count - 1;
2021-04-02 19:10:51 -05:00
internal override void OnCountChanged() => FirePropertyChanged("EndIndex");
2021-04-02 19:10:51 -05:00
private int GetSourceIndex(int groupedIndex) => StartIndex + groupedIndex;
2021-04-02 19:10:51 -05:00
internal bool ContainsSourceIndex(int sourceIndex) => StartIndex <= sourceIndex && sourceIndex <= EndIndex;
2021-04-02 19:10:51 -05:00
protected override object OnRequestItem(int index) => _groupedList.Source[GetSourceIndex(index)];
protected override void OnRequestSlowData(int groupedIndex)
{
2021-04-02 19:10:51 -05:00
if (!(_groupedList.Source is IVirtualList source) || !source.SlowDataRequestsEnabled)
return;
2021-04-02 19:10:51 -05:00
int sourceIndex = GetSourceIndex(groupedIndex);
if (sourceIndex >= source.Count)
return;
source.NotifyRequestSlowData(sourceIndex);
}
2021-03-31 17:15:06 -05:00
public override string ToString() => "Group [" + StartIndex + "-" + EndIndex + "]";
}
}