Exemplo n.º 1
0
        public bool Contains(SelectionCellRangeWithItems rangeWithItems)
        {
            if ((m_unsortedRanges.Count <= 0) || (SelectedCellsStorage.IsEmpty(rangeWithItems)))
            {
                return(false);
            }

            if (rangeWithItems.Length == 1)
            {
                return(this.IndexOfOverlap(rangeWithItems).Any());
            }

            var store = new SelectedCellsStorage(null);

            store.Add(rangeWithItems);

            foreach (var match in this.IndexOfOverlap(rangeWithItems))
            {
                store.Remove(m_unsortedRanges[match].Value);

                if (store.Count == 0)
                {
                    return(true);
                }
            }

            return(false);
        }