private void dgShowCPU_SelectionChanged(object sender, EventArgs e) { foreach (DataGridViewRow row in dgShowCPU.SelectedRows) { CpuInfo cpu = new CpuInfo() { Name = row.Cells["ModelCPU"].Value?.ToString(), ProcessorId = "" }; ShowPCtoList(dicPC, cpu); } }
public bool IsSame(object obj) { if (obj is CpuInfo) { CpuInfo cpu = obj as CpuInfo; if (this.Name == cpu.Name) { return(true); } else { return(false); } } MessageBox.Show("this obj not a CPU"); return(false); }