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); }
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)); } }
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); }
public static void MoveUnitBounded(MarkupPointer p, MoveDirection direction, MarkupPointerAdjacency stopRule, MarkupPointer boundary) { MoveContextFilter filter = CreateMoveContextFilter(stopRule); MoveUnitBounded(p, direction, filter, boundary); }
private static bool FlagNotSet(MarkupPointerAdjacency flag, MarkupPointerAdjacency flagMask) { return(!FlagIsSet(flag, flagMask)); }
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); }