/** * reloads data from data source. the view will be refreshed. */ public void ReloadData() { m_eOldDirection = CCScrollViewDirection.None; foreach (CCTableViewCell cell in m_pCellsUsed) { if (m_pTableViewDelegate != null) { m_pTableViewDelegate.TableCellWillRecycle(this, cell); } m_pCellsFreed.Add(cell); cell.Reset(); if (cell.Parent == Container) { Container.RemoveChild(cell, true); } } m_pIndices.Clear(); m_pCellsUsed = new CCArrayForObjectSorting(); _updateCellPositions(); _updateContentSize(); if (m_pDataSource.NumberOfCellsInTableView(this) > 0) { ScrollViewDidScroll(this); } }
public new bool InitWithViewSize(CCSize size, CCNode container) { if (base.InitWithViewSize(size, container)) { m_vCellsPositions = new List <float>(); m_pCellsUsed = new CCArrayForObjectSorting(); m_pCellsFreed = new CCArrayForObjectSorting(); m_pIndices = new List <int>(); m_eVordering = CCTableViewVerticalFillOrder.FillBottomUp; Direction = CCScrollViewDirection.Vertical; base.Delegate = this; return(true); } return(false); }
/** * reloads data from data source. the view will be refreshed. */ public void ReloadData() { foreach (CCTableViewCell cell in m_pCellsUsed) { m_pCellsFreed.Add(cell); cell.Reset(); if (cell.Parent == Container) { Container.RemoveChild(cell, true); } } m_pIndices.Clear(); m_pCellsUsed = new CCArrayForObjectSorting(); _updateContentSize(); if (m_pDataSource.NumberOfCellsInTableView(this) > 0) { ScrollViewDidScroll(this); } }