/// <summary>
    /// Initializes a new instance of the <see cref="BookmarkEventArgs"/> class.
    /// </summary>
    /// <param name="bookmark">The bookmark.</param>
		public BookmarkEventArgs(Bookmark bookmark)
		{
			this.bookmark = bookmark;
		}
    /// <summary>
    /// Sets the mark at the line <c>lineNr</c> if it is not set, if the
    /// line is already marked the mark is cleared.
    /// </summary>
    /// <param name="lineNr">The line number.</param>
    public void ToggleMarkAt(int lineNr)
    {
      Bookmark newMark;
      if (factory != null)
        newMark = factory.CreateBookmark(document, lineNr);
      else
        newMark = new Bookmark(document, lineNr);

      Type newMarkType = newMark.GetType();

      for (int i = 0; i < bookmark.Count; ++i)
      {
        Bookmark mark = bookmark[i];

        if (mark.LineNumber == lineNr && mark.CanToggle && mark.GetType() == newMarkType)
        {
          bookmark.RemoveAt(i);
          OnRemoved(new BookmarkEventArgs(mark));
          return;
        }
      }

      bookmark.Add(newMark);
      OnAdded(new BookmarkEventArgs(newMark));
    }
 /// <summary>
 /// Accepts any mark.
 /// </summary>
 /// <param name="mark">The mark.</param>
 /// <returns>Always <c>true</c>.</returns>
 public static bool AcceptAnyMarkPredicate(Bookmark mark)
 {
   return true;
 }
 /// <summary>
 /// Removes the bookmark.
 /// </summary>
 /// <param name="mark">The bookmark.</param>
 public void RemoveMark(Bookmark mark)
 {
   bookmark.Remove(mark);
   OnRemoved(new BookmarkEventArgs(mark));
 }
 /// <summary>
 /// Adds a bookmark.
 /// </summary>
 /// <param name="mark">The bookmark.</param>
 public void AddMark(Bookmark mark)
 {
   bookmark.Add(mark);
   OnAdded(new BookmarkEventArgs(mark));
 }
    /// <summary>
    /// Initializes a new instance of the <see cref="BookmarkEventArgs"/> class.
    /// </summary>
    /// <param name="bookmark">The bookmark.</param>
		public BookmarkEventArgs(Bookmark bookmark)
		{
			_bookmark = bookmark;
		}