Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 void SetScalarItemsAsUsed()
 {
     if (ScalarCollection.Any(sc => sc.IsUsed == false))
     {
         foreach (var dataListItemModel in ScalarCollection)
         {
             dataListItemModel.IsUsed = true;
         }
     }
 }
Esempio n. 3
0
        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);
        }