Example #1
0
        private Group <TDataItem> FindGroup(Group <TDataItem> group, GroupCollection <TDataItem> groups)
        {
            if (groups.Count == 0)
            {
                return(null);
            }

            int index = groups.IndexOf(group);

            if (index >= 0)
            {
                return(groups[index]);
            }

            foreach (Group <TDataItem> childGroup in groups)
            {
                Group <TDataItem> match = this.FindGroup(group, childGroup.Groups);
                if (match != null)
                {
                    return(match);
                }
            }

            return(null);
        }
Example #2
0
        private Group <TDataItem> FindGroup(
            Group <TDataItem> group,
            GroupCollection <TDataItem> groups)
        {
            if (groups.Count == 0)
            {
                return((Group <TDataItem>)null);
            }
            int index = groups.IndexOf(group);

            if (index >= 0)
            {
                return(groups[index]);
            }
            foreach (Group <TDataItem> group1 in (ReadOnlyCollection <Group <TDataItem> >)groups)
            {
                Group <TDataItem> group2 = this.FindGroup(group, group1.Groups);
                if (group2 != null)
                {
                    return(group2);
                }
            }
            return((Group <TDataItem>)null);
        }