private void btnCompare_Click(object sender, EventArgs e) { string kit1 = dataGridView1.SelectedRows[0].Cells[0].Value.ToString(); string kit2 = dataGridView2.SelectedRows[0].Cells[0].Value.ToString(); if (kit1 == kit2) { MessageBox.Show("Please select different kits to compare.", "One-to-One Compare", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } // open mdi child switch (selected_operation) { case SELECT_ADMIXTURE: GGKUtilLib.hideAllMdiChildren(); OneToOneCmpFrm cmp = new OneToOneCmpFrm(kit1, kit2); cmp.MdiParent = Program.GGKitFrmMainInst; cmp.Visible = true; cmp.WindowState = FormWindowState.Maximized; this.Close(); break; default: break; } // }
private void SelectKit(string kit) { switch (selected_operation) { case OPEN_KIT: GGKUtilLib.hideAllMdiChildren(); NewEditKitFrm newKitFrm = Program.GGKitFrmMainInst.getNewEditKitFrm(); if (newKitFrm == null) { newKitFrm = new NewEditKitFrm(kit, disabled.Contains(kit)); } if (newKitFrm.IsDisposed) { newKitFrm = new NewEditKitFrm(kit, disabled.Contains(kit)); } newKitFrm.MdiParent = Program.GGKitFrmMainInst; newKitFrm.Visible = true; newKitFrm.WindowState = FormWindowState.Maximized; break; case EXPORT_KIT: //ToDo: GGKUtilLib.hideAllMdiChildren(); if (saveFileDialog.ShowDialog(this) == DialogResult.OK) { btnOpen.Text = "Exporting ..."; btnOpen.Enabled = false; GGKUtilLib.setStatus("Exporting. Please wait ..."); bwExport.RunWorkerAsync(new string[] { kit, saveFileDialog.FileName, saveFileDialog.FilterIndex.ToString() }); } return; case SELECT_ONE_TO_MANY: GGKUtilLib.hideAllMdiChildren(); MatchingKitsFrm frm = new MatchingKitsFrm(kit); frm.MdiParent = Program.GGKitFrmMainInst; frm.Visible = true; frm.WindowState = FormWindowState.Maximized; break; case SELECT_ADMIXTURE: GGKUtilLib.hideAllMdiChildren(); AdmixtureFrm afrm = new AdmixtureFrm(kit); afrm.MdiParent = Program.GGKitFrmMainInst; afrm.Visible = true; afrm.WindowState = FormWindowState.Maximized; break; case SELECT_ROH: GGKUtilLib.hideAllMdiChildren(); ROHFrm rohfrm = new ROHFrm(kit); rohfrm.MdiParent = Program.GGKitFrmMainInst; rohfrm.Visible = true; rohfrm.WindowState = FormWindowState.Maximized; break; case SELECT_KIT: this.kit = kit; this.Visible = false; return; case SELECT_MTPHYLOGENY: GGKUtilLib.hideAllMdiChildren(); MtPhylogenyFrm mtFrm = new MtPhylogenyFrm(kit); mtFrm.MdiParent = Program.GGKitFrmMainInst; mtFrm.Visible = true; mtFrm.WindowState = FormWindowState.Maximized; break; case SELECT_MITOMAP: GGKUtilLib.hideAllMdiChildren(); MitoMapFrm mpFrm = new MitoMapFrm(kit); mpFrm.MdiParent = Program.GGKitFrmMainInst; mpFrm.Visible = true; mpFrm.WindowState = FormWindowState.Maximized; break; case SELECT_ISOGGYTREE: GGKUtilLib.hideAllMdiChildren(); IsoggYTreeFrm yFrm = new IsoggYTreeFrm(kit); yFrm.MdiParent = Program.GGKitFrmMainInst; yFrm.Visible = true; yFrm.WindowState = FormWindowState.Maximized; break; default: break; } this.Close(); }