/** * 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); } }
/** * 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_pCellsUsed = new CCArrayForObjectSorting(); m_pCellsFreed = new CCArrayForObjectSorting(); m_pIndices = new List<int>(); m_pTableViewDelegate = null; m_eVordering = CCTableViewVerticalFillOrder.FillBottomUp; Direction = CCScrollViewDirection.Vertical; base.Delegate = this; return true; } return false; }
public CCTableView(ICCTableViewDataSource dataSource, CCSize size, CCNode container) : base(size, container) { cellsPositions = new List<float>(); cellsUsed = new CCArrayForObjectSorting(); cellsFreed = new CCArrayForObjectSorting(); indices = new List<int>(); vordering = CCTableViewVerticalFillOrder.FillBottomUp; Direction = CCScrollViewDirection.Vertical; base.Delegate = this; DataSource = dataSource; UpdateCellPositions(); UpdateContentSize(); }