Ejemplo n.º 1
0
        /// <summary>
        /// Returns true if the specified element begins and ends within the range.
        /// </summary>
        /// <param name="e"></param>
        /// <returns></returns>
        private bool isInScope(IHTMLElement e)
        {
            MarkupPointer p = MarkupServices.CreateMarkupPointer(e, _ELEMENT_ADJACENCY.ELEM_ADJ_BeforeBegin);

            if (p.IsRightOfOrEqualTo(Start))
            {
                p = MarkupServices.CreateMarkupPointer(e, _ELEMENT_ADJACENCY.ELEM_ADJ_AfterEnd);
                if (p.IsLeftOfOrEqualTo(End))
                {
                    return(true);
                }
            }
            return(false);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Returns true if the specified pointer is in a position between, or equal to the start/end points.
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 private static bool isInRange(MarkupPointer start, MarkupPointer end, MarkupPointer p)
 {
     return start.IsLeftOfOrEqualTo(p) && end.IsRightOfOrEqualTo(p);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Returns true if the specified pointer is in a position between, or equal to the start/end points.
 /// </summary>
 /// <param name="p"></param>
 /// <returns></returns>
 private static bool isInRange(MarkupPointer start, MarkupPointer end, MarkupPointer p)
 {
     return(start.IsLeftOfOrEqualTo(p) && end.IsRightOfOrEqualTo(p));
 }
 /// <summary>
 /// Returns the markup pointer that is most deeply placed within the DOM.
 /// </summary>
 /// <param name="p1"></param>
 /// <param name="p2"></param>
 /// <returns></returns>
 private MarkupPointer GetDeeperPoint(MarkupPointer p1, MarkupPointer p2)
 {
     IHTMLElement startElement = p1.CurrentScope;
     IHTMLElement endElement = p2.CurrentScope;
     int startSourceIndex = startElement != null ? startElement.sourceIndex : -1;
     int endSourceIndex = startElement != null ? endElement.sourceIndex : -1;
     if (startSourceIndex > endSourceIndex || (startSourceIndex == endSourceIndex && p1.IsRightOfOrEqualTo(p2)))
         return p1;
     else
         return p2;
 }