예제 #1
0
        public IEnumerator GetEnumerator()
        {
            Debug.Assert(this.OwningGrid != null);
            Debug.Assert(this.OwningGrid.DataConnection != null);
            Debug.Assert(_selectedSlotsTable != null);

            foreach (int slot in _selectedSlotsTable.GetIndexes())
            {
                int rowIndex = this.OwningGrid.RowIndexFromSlot(slot);
                Debug.Assert(rowIndex > -1);
                yield return(this.OwningGrid.DataConnection.GetDataItem(rowIndex));
            }
        }
예제 #2
0
        private static IEnumerable <object> GetSelectedItems(DataGrid owningGrid, IndexToValueTable <bool> selectedItemsTable)
        {
            Debug.Assert(owningGrid != null);
            Debug.Assert(owningGrid.DataConnection != null);
            Debug.Assert(selectedItemsTable != null);

            DataGridDataConnection dataConnection = owningGrid.DataConnection;

            foreach (int rowIndex in selectedItemsTable.GetIndexes())
            {
                Debug.Assert(rowIndex > -1);
                yield return(dataConnection.GetDataItem(rowIndex));
            }
        }