protected void loadItem(int i, Group page) { GraphicObject g = null; ItemTemplate iTemp = null; Type dataType = data [i].GetType(); if (ItemTemplates.ContainsKey(dataType.FullName)) { iTemp = ItemTemplates [dataType.FullName]; } else { iTemp = ItemTemplates ["default"]; } lock (CurrentInterface.LayoutMutex) { g = iTemp.CreateInstance(CurrentInterface); page.AddChild(g); g.DataSource = data [i]; } registerItemClick(g); if (iTemp.Expand != null && g is Expandable) { (g as Expandable).Expand += iTemp.Expand; } }
void loading() { if (ItemTemplates == null) { ItemTemplates = new Dictionary <string, ItemTemplate> (); } if (!ItemTemplates.ContainsKey("default")) { ItemTemplates ["default"] = Interface.GetItemTemplate(ItemTemplate); } for (int i = 1; i <= (data.Count / itemPerPage) + 1; i++) { if (cancelLoading) { return; } loadPage(i); } }