private void ShowResults(List <DataModel.SearchResultRecordV3_1> list) { if (InvokeRequired) { Invoke(new Action <List <DataModel.SearchResultRecordV3_1> >(ShowResults), list); } else { for (int i = 0; i < 36; i++) { int row = i % 6; int col = i / 6; ucSingleSearchResult c = ControlList[row, col] as ucSingleSearchResult; if (c != null) { c.Visible = false; } } for (int i = 0; i < Math.Min(list.Count, m_showColumnCount * m_showColumnCount); i++) { int row = i % m_showColumnCount; int col = i / m_showColumnCount; ucSingleSearchResult c = ControlList[row, col] as ucSingleSearchResult; if (c != null) { c.ShowResult(list[i]); c.Visible = true; } } } }
void uc_Click(object sender, EventArgs e) { ucSingleSearchResult uc = sender as ucSingleSearchResult; if (uc != null && uc.Checked) { m_currentResult = uc; } }
void uc_DoubleClick(object sender, EventArgs e) { ucSingleSearchResult uc = sender as ucSingleSearchResult; if (uc != null && uc.Checked) { m_currentResult = uc; FormSingleSearchDitailResult r = new FormSingleSearchDitailResult(); r.Init(m_viewModel, m_taskId); r.ShowResult(uc.Record); r.ShowDialog(); r.Clear(); r.Dispose(); r = null; } }
public ucSingleSearchResultPanel() { InitializeComponent(); tableLayoutPanel1.Controls.Clear(); for (int i = 0; i < 36; i++) { ucSingleSearchResult uc = new ucSingleSearchResult(); uc.Group = 1; uc.Click += uc_Click; uc.DoubleClick += uc_DoubleClick; uc.Visible = false; uc.Dock = DockStyle.Fill; int row = i % 6; int col = i / 6; this.tableLayoutPanel1.Controls.Add(uc, row, col); ControlList[row, col] = uc; } }