Accordion.Forms.AccordionControl.OnCellTouchUpInside C# (CSharp) Method

OnCellTouchUpInside() public method

Raises the cell touch up inside event.
public OnCellTouchUpInside ( int cellIndex ) : void
cellIndex int cell index.
return void
        void OnCellTouchUpInside(int cellIndex)
        {
            var touchedEntry = m_entries[cellIndex];
            bool isTouchingToClose = touchedEntry.IsOpen;

            var entriesToClose = m_entries.Where(e => e.IsOpen);
            foreach (var entry in entriesToClose)
            {
                CloseAccordion(entry);
                entry.IsOpen = false;
            }

            if (!isTouchingToClose)
            {
                OpenAccordion(touchedEntry);
                touchedEntry.IsOpen = true;
            }
        }