Accordion.Forms.AccordionControl.OnCellTouchUpInside C# (CSharp) 메소드

OnCellTouchUpInside() 공개 메소드

Raises the cell touch up inside event.
public OnCellTouchUpInside ( int cellIndex ) : void
cellIndex int cell index.
리턴 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;
            }
        }