public void showBrcaScores() { foreach (AnnotationContainerSlot acs in upperRightList.slots) { if (acs.resident != null) { if (acs.resident.label != "Brca Score") { theHoldingPen.AddAnnotation(acs.resident); upperRightList.RemoveAnnotation(acs.resident); } } } Annotation a = null; foreach (AnnotationContainer ac in annotation_areas) { bool found = false; foreach (AnnotationContainerSlot acs in ac.slots) { if (acs.resident != null) { if (acs.resident.label == "Brca Score") { a = acs.resident; found = true; break; } } } if (found) { break; } } if (a != null) { foreach (AnnotationContainer ac in annotation_areas) { if (ac.area == "upperRightList") { if (a.StartingContainer != ac) { ac.AddAnnotation(a); a.hraAnnotation.area = ac.area; } } else { ac.RemoveAnnotation(a); } } } }
private void AddAnnotation(Annotation a, AnnotationContainer ac) { a.MouseMove += new System.Windows.Forms.MouseEventHandler(this.annotation_MouseMove); a.MouseDown += new System.Windows.Forms.MouseEventHandler(this.annotation_MouseDown); a.MouseUp += new System.Windows.Forms.MouseEventHandler(this.annotation_MouseUp); a.MouseEnter += new System.EventHandler(this.annotation_MouseEnter); a.MouseLeave += new System.EventHandler(this.annotation_MouseLeave); tabPage1.Controls.Add(a); a.BringToFront(); ac.AddAnnotation(a); }