public ListItem(CurseListItem it, int index) { item = it; InitializeComponent(); if (null != item.title) { labeltitle.Text = item.title; } if (null != item.description) { labeldescription.Text = item.description; } if (null != item.update) { labelupdate.Text = item.update; } if (null != item.download) { labeldownload.Text = item.download; } if (null != item.thumbnails) { //System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(this.updatePic)); pictureBoxThumb.ImageLocation = item.thumbnails; } pictureBoxInstalled.Visible = it.isInstall; id = index; }
void UpdateDetailHeader(CurseListItem li) { if (splitContainer2.InvokeRequired) { this.Invoke(new UpdateDetailHeaderDelegate(UpdateDetailHeaderFunction), li); } }
void UpdateDetailHeaderFunction(CurseListItem li) { if (null == li) { splitContainer2.Visible = false; labelDetailTitle.Text = ""; labelDetialUpdate.Text = ""; pictureBoxDetail.ImageLocation = ""; } else { splitContainer2.Show(); labelDetailTitle.Text = li.title; labelDetialUpdate.Text = li.update; pictureBoxDetail.ImageLocation = li.thumbnails; if (li.isInstall) { BtDetailInstall.Text = "已安装"; BtDetailInstall.Enabled = false; BtDetailInstall.BackColor = Color.Gray; } else { BtDetailInstall.Text = "安装"; BtDetailInstall.Enabled = true; BtDetailInstall.BackColor = Color.MediumTurquoise; } } }
private void GetDetail(CurseListItem cli) { currentItem = cli; ThreadStart detail = new ThreadStart(PraseDetail); Thread detailThread = new Thread(detail) { IsBackground = true }; detailThread.Start(); }