internal Annotation FindByName(string name, ref AnnotationGroup group)
        {
            Annotation annotation = null;

            group = null;
            for (int i = 0; i < base.List.Count; i++)
            {
                if (string.Compare(this[i].Name, name, StringComparison.Ordinal) == 0)
                {
                    annotation = this[i];
                    break;
                }
                AnnotationGroup annotationGroup = this[i] as AnnotationGroup;
                if (annotationGroup != null)
                {
                    annotation = annotationGroup.Annotations.FindByName(name, ref group);
                    if (annotation != null)
                    {
                        group = annotationGroup;
                        break;
                    }
                }
            }
            return(annotation);
        }
        public int AddGroup(string name)
        {
            AnnotationGroup annotationGroup = new AnnotationGroup();

            if (name.Length > 0)
            {
                annotationGroup.Name = name;
            }
            return(base.List.Add(annotationGroup));
        }
 public void Remove(Annotation annotation)
 {
     if (annotation != null)
     {
         AnnotationGroup annotationGroup = annotation.GetAnnotationGroup();
         if (annotationGroup != null)
         {
             annotationGroup.Annotations.List.Remove(annotation);
         }
         else
         {
             base.List.Remove(annotation);
         }
     }
 }
        public void Remove(string name)
        {
            Annotation annotation = FindByName(name);

            if (annotation != null)
            {
                AnnotationGroup annotationGroup = annotation.GetAnnotationGroup();
                if (annotationGroup != null)
                {
                    annotationGroup.Annotations.List.Remove(annotation);
                }
                else
                {
                    base.List.Remove(annotation);
                }
            }
        }
        public Annotation FindByName(string name)
        {
            AnnotationGroup group = null;

            return(FindByName(name, ref group));
        }