public void processContour() { if (currentContour != null) { // Contour is drawn, process it now if (currentContour.getDrawnPoints().Count > 2) { SelectBone bone = new SelectBone(); var result = bone.ShowDialog(); if (result == DialogResult.OK) { currentContour.setName(bone.ReturnValue1); currentContour.setLabel(currentContour.getLabelPosition()); currentContour.setDone(); MainView.Instance.setDrawing(); MainView.Instance.removeContourOptions(); DrawHandler.Instance.clearFishLines(); ImageHandler.Instance.refreshImage(); } else { currentContour.getDrawnPoints().Clear(); } } } }
/* Rename */ private void button2_Click(object sender, EventArgs e) { if (listBox1.SelectedIndex != -1) { string name = (string)listBox1.Items[listBox1.SelectedIndex]; foreach (BaseContour c in list) { if (c.getName() == name) { SelectBone bone = new SelectBone(); var result = bone.ShowDialog(); if (result == DialogResult.OK) { c.setName(bone.ReturnValue1); listBox1.Items[listBox1.SelectedIndex] = c.getName(); } break; } } } }