private void drawingManager_OnAnnotationSelect(object sender, Annotation selectedAnnotation) { this.txtAnnotationLabel.Text = selectedAnnotation.Label; this.txtAnnotationLabel.SelectionStart = this.txtAnnotationLabel.SelectionLength = 0; }
public void Add(Annotation annotation) { DrawingAnnotation drawingAnn = null; foreach (var prototype in prototypes) { if (prototype.BelongsTo(annotation.Polygon)) { drawingAnn = (DrawingAnnotation)Activator.CreateInstance(prototype.GetType()); drawingAnn.Initialize(pictureBox); drawingAnn.Annotation = annotation; drawingAnn.IsSelected = false; drawingAnn.ShowLabel = this.ShowLabels; break; } } if (drawingAnn == null) throw new Exception("Could not determine the drawing annotation type!"); drawingAnnotations.Add(drawingAnn); }