Exemplo n.º 1
0
        /// <summary>
        /// Removes the markup from the given element if any known.
        /// </summary>
        public void UnmarkElement(HtmlElement e)
        {
            e.Require(x => e != null);

            if (!IsMarked(e))
            {
                return;
            }

            e.UnmarkElement();

            MarkedElements.Remove(e);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Marks the given element with the given color.
        /// </summary>
        public void MarkElement(HtmlElement e, Color color)
        {
            e.Require(x => e != null);

            if (IsMarked(e))
            {
                // unmark first - maybe it was marked with another color before
                UnmarkElement(e);
            }

            e.MarkElement(color);

            MarkedElements.Add(e);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Removes all the known markups.
 /// </summary>
 public void UnmarkAll()
 {
     MarkedElements.ToList().Foreach(UnmarkElement);
 }
Exemplo n.º 4
0
        /// <summary>
        /// Indicates whether the given element is marked.
        /// </summary>
        public bool IsMarked(HtmlElement e)
        {
            e.Require(x => e != null);

            return(MarkedElements.Contains(e));
        }