private ListViewItem GetNextLvi(ListViewGroup gBaseExcl, bool bUp)
{
if(gBaseExcl == null) { Debug.Assert(false); return null; }
int i = this.Groups.IndexOf(gBaseExcl);
if(i < 0) { Debug.Assert(false); return null; }
if(bUp)
{
--i;
while(i >= 0)
{
ListViewGroup g = this.Groups[i];
if(g.Items.Count > 0) return g.Items[g.Items.Count - 1];
--i;
}
}
else // Down
{
++i;
int nGroups = this.Groups.Count;
while(i < nGroups)
{
ListViewGroup g = this.Groups[i];
if(g.Items.Count > 0) return g.Items[0];
++i;
}
}
return null;
}