Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: d3686ac971
Fetching contributors…

Cannot retrieve contributors at this time

83 lines (69 sloc) 1.85 kB
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
namespace Pybrary.Plot
{
public class AnnotationCollection : EventObject, ICollection<Annotation>
{
private List<Annotation> annotations = new List<Annotation>();
public AnnotationCollection()
{
}
public void Draw(Graphics g, AdvancedRect dataArea)
{
foreach (Annotation ann in annotations)
ann.Draw(g, dataArea);
}
public int Count
{
get
{
return annotations.Count;
}
}
public bool IsReadOnly
{
get
{
return false;
}
}
public void Add(Annotation item)
{
annotations.Add(item);
raiseEvent();
}
public void Clear()
{
annotations.Clear();
raiseEvent();
}
public bool Remove(Annotation item)
{
if (annotations.Remove(item))
{
raiseEvent();
return true;
}
return false;
}
public bool Contains(Annotation item)
{
return annotations.Contains(item);
}
public void CopyTo(Annotation[] arr, int arrIdx)
{
for (int i = 0; i < annotations.Count; i++)
arr[i + arrIdx] = annotations[i];
}
public IEnumerator<Annotation> GetEnumerator()
{
return new ListEnumerator<Annotation>(annotations);
}
IEnumerator IEnumerable.GetEnumerator()
{
return GetEnumerator();
}
}
}
Jump to Line
Something went wrong with that request. Please try again.