Example #1
0
 void DoRefreshDataSource()
 {
     mItemDataList.Clear();
     for (int i = 0; i < mTreeViewItemCount; ++i)
     {
         TreeViewItemData tData = new TreeViewItemData();
         tData.mName = "Item" + i;
         tData.mIcon = ResManager.Get.GetSpriteNameByIndex(Random.Range(0, 24));
         mItemDataList.Add(tData);
         int childCount = mTreeViewChildItemCount;
         for (int j = 1; j <= childCount; ++j)
         {
             ItemData childItemData = new ItemData();
             childItemData.mName      = "Item" + i + ":Child" + j;
             childItemData.mDesc      = "Item Desc For " + childItemData.mName;
             childItemData.mIcon      = ResManager.Get.GetSpriteNameByIndex(Random.Range(0, 24));
             childItemData.mStarCount = Random.Range(0, 6);
             childItemData.mFileSize  = Random.Range(20, 999);
             tData.AddChild(childItemData);
         }
     }
 }
 private void DoRefreshDataSource()
 {
     this.mItemDataList.Clear();
     for (int index1 = 0; index1 < this.mTreeViewItemCount; ++index1)
     {
         TreeViewItemData treeViewItemData = new TreeViewItemData();
         treeViewItemData.mName = "Item" + (object)index1;
         treeViewItemData.mIcon = ResManager.Get.GetSpriteNameByIndex(Random.Range(0, 24));
         this.mItemDataList.Add(treeViewItemData);
         int viewChildItemCount = this.mTreeViewChildItemCount;
         for (int index2 = 1; index2 <= viewChildItemCount; ++index2)
         {
             ItemData data = new ItemData()
             {
                 mName = "Item" + (object)index1 + ":Child" + (object)index2
             };
             data.mDesc      = "Item Desc For " + data.mName;
             data.mIcon      = ResManager.Get.GetSpriteNameByIndex(Random.Range(0, 24));
             data.mStarCount = Random.Range(0, 6);
             data.mFileSize  = Random.Range(20, 999);
             treeViewItemData.AddChild(data);
         }
     }
 }