private void button1_Click(object sender, EventArgs e) { DataGridViewCellCollection cell = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells; string name = (string)cell[0].Value; ClusterGraphVis vis = new ClusterGraphVis(manager.clOutput[name], name, manager.clOutput); vis.SClusters(name, cell[2].Value.ToString(), "");; }
private void menuClick() { if (dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].DefaultCellStyle.ForeColor == Color.Green) { DataGridViewCellCollection cell = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells; string name = (string)cell[0].Value; //if(cell[cell.Count-1].Value!=null) // name = (string)cell[cell.Count-1].Value; if (manager.clOutput.ContainsKey(name)) { ClusterGraphVis vis = new ClusterGraphVis(manager.clOutput[name], name); vis.SClusters(name, dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[2].Value.ToString(), null); } } }
private void SubMenuClick(object sender, EventArgs e) { ToolStripItem item = sender as ToolStripItem; try { DataGridViewCellCollection cell = dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells; string name = (string)cell[0].Value; ClusterGraphVis vis = new ClusterGraphVis(manager.clOutput[name], name, manager.clOutput); vis.SClusters(name, cell[2].Value.ToString(), item.Text); // cell[cell.Count - 1].Value = vis.ToString(); } catch (Exception ex) { MessageBox.Show("Error: " + ex.Message); } }
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e) { if (dataGridView1.Rows.Count == 0) { for (int i = 0; i < contextMenuStrip1.Items.Count; i++) { if (contextMenuStrip1.Items[i].Text.Contains("Save") || contextMenuStrip1.Items[i].Text.Contains("Show") || contextMenuStrip1.Items[i].Text.Contains("Close")) { contextMenuStrip1.Items[i].Enabled = false; } } return; } else { for (int i = 0; i < contextMenuStrip1.Items.Count; i++) { contextMenuStrip1.Items[i].Enabled = true; } } if (dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[4].Value == null) { for (int i = 0; i < contextMenuStrip1.Items.Count; i++) { if (contextMenuStrip1.Items[i].Text.Contains("Save current") || contextMenuStrip1.Items[i].Text.Contains("Show")) { contextMenuStrip1.Items[i].Enabled = false; } } gotoProcessToolStripMenuItem.Enabled = false; finishProcessToolStripMenuItem.Text = "End Process"; } else { finishProcessToolStripMenuItem.Text = "Close result"; gotoProcessToolStripMenuItem.Enabled = true; } if (dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].DefaultCellStyle.ForeColor == Color.Green) { if (manager.clOutput.ContainsKey((string)dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value)) { List <string> options = ClusterGraphVis.GetVisOptions(manager.clOutput[(string)dataGridView1.Rows[dataGridView1.SelectedRows[0].Index].Cells[0].Value]); gotoProcessToolStripMenuItem.DropDownItems.Clear(); if (options != null) { gotoProcessToolStripMenuItem.Click -= gotoProcessToolStripMenuItem_Click; foreach (var item in options) { ToolStripItem it = gotoProcessToolStripMenuItem.DropDownItems.Add(item); it.Click += new EventHandler(SubMenuClick); } } else { gotoProcessToolStripMenuItem.Click -= gotoProcessToolStripMenuItem_Click; gotoProcessToolStripMenuItem.Click += gotoProcessToolStripMenuItem_Click; } } } }