Exemplo n.º 1
0
 private void SetPrevSectionItem(float currentPos, int prevIndex)
 {
     if (prevIndex != -1)
     {
         ListPanel.ListPanelSectionItem listPanelSectionItem = this.CreateSectionItem();
         this.UpdateSectionItem(listPanelSectionItem, prevIndex);
         listPanelSectionItem.Y = currentPos - listPanelSectionItem.ContainEdgeHeight;
         this.displayAllItems.Insert(0, listPanelSectionItem);
     }
 }
Exemplo n.º 2
0
 private void SetNextSectionItem(float nextPos, int nextIndex)
 {
     if (nextIndex != this.Sections.Count)
     {
         ListPanel.ListPanelSectionItem listPanelSectionItem = this.CreateSectionItem();
         this.UpdateSectionItem(listPanelSectionItem, nextIndex);
         listPanelSectionItem.Y = nextPos;
         this.displayAllItems.Add(listPanelSectionItem);
     }
 }
Exemplo n.º 3
0
 private void UpdateSectionItem(ListPanel.ListPanelSectionItem item, int sectionIndex)
 {
     item.Title        = this.Sections[sectionIndex].Title;
     item.SectionIndex = sectionIndex;
     if (this.displaySectionItems.Count > 0 && this.displaySectionItems[0].SectionIndex > item.SectionIndex)
     {
         this.displaySectionItems.Insert(0, item);
         return;
     }
     this.displaySectionItems.Add(item);
 }
Exemplo n.º 4
0
 private ListPanel.ListPanelSectionItem CreateSectionItem()
 {
     ListPanel.ListPanelSectionItem listPanelSectionItem;
     if (this.cacheSectionItems.Count == 0)
     {
         listPanelSectionItem = new ListPanel.ListPanelSectionItem();
         this.AddChildLast(listPanelSectionItem);
     }
     else
     {
         listPanelSectionItem = this.cacheSectionItems[0];
         this.cacheSectionItems.Remove(listPanelSectionItem);
     }
     listPanelSectionItem.Width   = this.Width;
     listPanelSectionItem.Height  = 47f;
     listPanelSectionItem.Visible = true;
     return(listPanelSectionItem);
 }
Exemplo n.º 5
0
 private void DestroySectionItem(ListPanel.ListPanelSectionItem item)
 {
     item.Visible = false;
     this.displaySectionItems.Remove(item);
     this.cacheSectionItems.Add(item);
 }