Example #1
0
        public static void MoveUnitBounded(MarkupPointer p, MoveDirection direction, MarkupPointerAdjacency stopRule, IHTMLElement boundary)
        {
            MarkupPointer pBoundary = p.Clone();

            pBoundary.MoveAdjacentToElement(boundary, direction == MoveDirection.LEFT ? _ELEMENT_ADJACENCY.ELEM_ADJ_AfterBegin : _ELEMENT_ADJACENCY.ELEM_ADJ_BeforeEnd);
            MoveUnitBounded(p, direction, stopRule, pBoundary);
        }
Example #2
0
        private static MoveContextFilter CreateMoveContextFilter(MarkupPointerAdjacency stopRule)
        {
            ArrayList stopFilters = new ArrayList();

            if (FlagIsSet(MarkupPointerAdjacency.BeforeText, stopRule))
            {
                stopFilters.Add(new MoveContextFilter(StopBeforeText));
            }
            if (FlagIsSet(MarkupPointerAdjacency.AfterEnterBlock, stopRule))
            {
                stopFilters.Add(new MoveContextFilter(StopAfterEnterBlock));
            }
            if (FlagIsSet(MarkupPointerAdjacency.BeforeExitBlock, stopRule))
            {
                stopFilters.Add(new MoveContextFilter(StopBeforeExitBlock));
            }
            if (FlagIsSet(MarkupPointerAdjacency.BeforeVisible, stopRule))
            {
                stopFilters.Add(new MoveContextFilter(StopBeforeVisible));
            }
            if (FlagIsSet(MarkupPointerAdjacency.BeforeEnterScope, stopRule))
            {
                stopFilters.Add(new MoveContextFilter(StopBeforeEnterScope));
            }

            if (stopFilters.Count > 0)
            {
                return(MergeContextFilters((MoveContextFilter[])stopFilters.ToArray(typeof(MoveContextFilter))));
            }
            else
            {
                return(new MoveContextFilter(ContinueFilter));
            }
        }
Example #3
0
        private static bool FlagIsSet(MarkupPointerAdjacency flag, MarkupPointerAdjacency flagMask)
        {
            ulong flagLong = (ulong)flag;
            ulong mask     = ((ulong)flagMask) & flagLong;

            return(mask == flagLong);
        }
        private static MoveContextFilter CreateMoveContextFilter(MarkupPointerAdjacency stopRule)
        {
            ArrayList stopFilters = new ArrayList();
            if (FlagIsSet(MarkupPointerAdjacency.BeforeText, stopRule))
                stopFilters.Add(new MoveContextFilter(StopBeforeText));
            if (FlagIsSet(MarkupPointerAdjacency.AfterEnterBlock, stopRule))
                stopFilters.Add(new MoveContextFilter(StopAfterEnterBlock));
            if (FlagIsSet(MarkupPointerAdjacency.BeforeExitBlock, stopRule))
                stopFilters.Add(new MoveContextFilter(StopBeforeExitBlock));
            if (FlagIsSet(MarkupPointerAdjacency.BeforeVisible, stopRule))
                stopFilters.Add(new MoveContextFilter(StopBeforeVisible));
            if (FlagIsSet(MarkupPointerAdjacency.BeforeEnterScope, stopRule))
                stopFilters.Add(new MoveContextFilter(StopBeforeEnterScope));

            if (stopFilters.Count > 0)
                return MergeContextFilters((MoveContextFilter[])stopFilters.ToArray(typeof(MoveContextFilter)));
            else
                return new MoveContextFilter(ContinueFilter);
        }
Example #5
0
        public static void MoveUnitBounded(MarkupPointer p, MoveDirection direction, MarkupPointerAdjacency stopRule, MarkupPointer boundary)
        {
            MoveContextFilter filter = CreateMoveContextFilter(stopRule);

            MoveUnitBounded(p, direction, filter, boundary);
        }
Example #6
0
 private static bool FlagNotSet(MarkupPointerAdjacency flag, MarkupPointerAdjacency flagMask)
 {
     return(!FlagIsSet(flag, flagMask));
 }
 public static void MoveUnitBounded(MarkupPointer p, MoveDirection direction, MarkupPointerAdjacency stopRule, IHTMLElement boundary)
 {
     MarkupPointer pBoundary = p.Clone();
     pBoundary.MoveAdjacentToElement(boundary, direction == MoveDirection.LEFT ? _ELEMENT_ADJACENCY.ELEM_ADJ_AfterBegin : _ELEMENT_ADJACENCY.ELEM_ADJ_BeforeEnd);
     MoveUnitBounded(p, direction, stopRule, pBoundary);
 }
 public static void MoveUnitBounded(MarkupPointer p, MoveDirection direction, MarkupPointerAdjacency stopRule, MarkupPointer boundary)
 {
     MoveContextFilter filter = CreateMoveContextFilter(stopRule);
     MoveUnitBounded(p, direction, filter, boundary);
 }
 private static bool FlagIsSet(MarkupPointerAdjacency flag, MarkupPointerAdjacency flagMask)
 {
     ulong flagLong = (ulong)flag;
     ulong mask = ((ulong)flagMask) & flagLong;
     return mask == flagLong;
 }
 private static bool FlagNotSet(MarkupPointerAdjacency flag, MarkupPointerAdjacency flagMask)
 {
     return !FlagIsSet(flag, flagMask);
 }