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

            group = null;
            int num = 0;

            while (num < base.List.Count)
            {
                if (string.Compare(this[num].Name, name, StringComparison.Ordinal) != 0)
                {
                    AnnotationGroup annotationGroup = this[num] as AnnotationGroup;
                    if (annotationGroup != null)
                    {
                        annotation = annotationGroup.Annotations.FindByName(name, ref group);
                        if (annotation != null)
                        {
                            group = annotationGroup;
                            break;
                        }
                    }
                    num++;
                    continue;
                }
                annotation = this[num];
                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 = this.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 annotationGroup = null;

            return(this.FindByName(name, ref annotationGroup));
        }