12345678910111213141516171819 |
- using System.Collections.ObjectModel;
- using System.Linq;
- namespace PRSDesktop
- {
- public class OrgChartEntries : ObservableCollection<OrgChartEntry>
- {
- public bool IsChildOf(OrgChartEntry child, OrgChartEntry parent)
- {
- if (child == null)
- return false;
- if (parent == null)
- return false;
- if (parent == child)
- return true;
- return IsChildOf(this.FirstOrDefault(x => x.ID == child.ParentID), parent);
- }
- }
- }
|