private bool HasAnyUnusedItems() { if (!HasItems()) { return(false); } bool hasUnused = false; if (ScalarCollection != null) { hasUnused = ScalarCollection.Any(sc => !sc.IsUsed); if (hasUnused) { return(true); } } if (RecsetCollection != null) { hasUnused = RecsetCollection.Any(sc => !sc.IsUsed); if (hasUnused) { return(true); } hasUnused = RecsetCollection.SelectMany(sc => sc.Children).Any(sc => !sc.IsUsed); } return(hasUnused); }
private bool HasAnyUnusedItems() { if (!HasItems()) { return(false); } bool hasUnused; if (ScalarCollection != null) { hasUnused = ScalarCollection.Any(sc => !sc.IsUsed); if (hasUnused) { DeleteCommand.RaiseCanExecuteChanged(); return(true); } } if (RecsetCollection != null) { hasUnused = RecsetCollection.Any(sc => !sc.IsUsed); if (!hasUnused) { hasUnused = RecsetCollection.SelectMany(sc => sc.Children).Any(sc => !sc.IsUsed); } if (hasUnused) { DeleteCommand.RaiseCanExecuteChanged(); return(true); } } if (ComplexObjectCollection != null) { hasUnused = ComplexObjectCollection.Any(sc => !sc.IsUsed); if (hasUnused) { DeleteCommand.RaiseCanExecuteChanged(); return(true); } } return(false); }