コード例 #1
0
        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);
        }
コード例 #2
0
        public int AddGroup(string name)
        {
            AnnotationGroup annotationGroup = new AnnotationGroup();

            if (name.Length > 0)
            {
                annotationGroup.Name = name;
            }
            return(base.List.Add(annotationGroup));
        }
コード例 #3
0
 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);
         }
     }
 }
コード例 #4
0
        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);
                }
            }
        }
コード例 #5
0
        public Annotation FindByName(string name)
        {
            AnnotationGroup annotationGroup = null;

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