private void imageButton1_Click(object sender, EventArgs e) { PackageForm form = new PackageForm("", new List <ImageApp>(), false); if (form.ShowDialog() == DialogResult.OK) { int i = appPackPanel.Controls.Count; AppPackage pack = new AppPackage(form.PackName, form.apps, this.androidDevicesPanel, false); pack.Location = new Point(10 + i * 180, 9); appPackPanel.Controls.Add(pack); } }
public static List <AppPackage> GetPackList(Panel panel) { XmlDocument xmlDom = new XmlDocument(); string xmlString = EnvInfo.HttpGet(api + "package"); xmlDom.LoadXml(xmlString); XmlNode node = xmlDom.ChildNodes[1].ChildNodes[2]; List <AppPackage> tempList = new List <AppPackage>(); for (int i = 0; i < node.ChildNodes.Count; i++) { string packName = node.ChildNodes[i].SelectSingleNode("title").InnerText; string ids = node.ChildNodes[i].SelectSingleNode("description").InnerText; List <ImageApp> apps = API.GetAppList(1, ids); AppPackage pack = new AppPackage(packName, apps, panel); pack.Location = new Point(10 + i * 180, 9); tempList.Add(pack); } return(tempList); }