Ejemplo n.º 1
0
        private Option <Tuple <int, int> > GetPreviousBounds(bool stopAtMark, bool ignoreNoMark)
        {
            Option <int> maybeIndex = new None();

            if (stopAtMark)
            {
                maybeIndex = GetPreviousMarkIndex().Apply(index => _marks[index].BufferIndex);
            }
            if (!stopAtMark || (maybeIndex.IsNone && ignoreNoMark))
            {
                maybeIndex = 0;
            }
            return(maybeIndex.Apply(index => GetPosFromIndex(index)));
        }
Ejemplo n.º 2
0
        private Option <Tuple <int, int> > GetNextBounds(bool stopAtMark, bool ignoreNoMark)
        {
            Option <int> maybeIndex = new None();

            if (stopAtMark)
            {
                maybeIndex = GetNextMarkIndex().Apply(index => _marks[index].BufferIndex);
            }
            if (!stopAtMark || (maybeIndex.IsNone && ignoreNoMark))
            {
                maybeIndex = Width.Value * Height.Value - 1;
            }
            return(maybeIndex.Apply(index => GetPosFromIndex(index)));
        }