Esempio n. 1
0
        public bool MoveFirst()
        {
            var moved = false;

            Array.Clear(_movedKeysFlags, 0, _movedKeysFlags.Length);
            _movedKeys.Clear();
            for (int i = 0; i < _cursors.Length; i++)
            {
                var c      = _cursors[i];
                var movedX = c.MoveFirst();
                if (movedX)
                {
                    _movedKeysFlags[i] = true;
                    _movedKeys.Add(new KeyValuePair <TKey, int>(c.CurrentKey, i));
                }
                moved = moved || movedX;
            }
            if (moved)
            {
                CurrentKey = _movedKeys.First.Key;
                // keep navigating state unchanged
                if (moved && State == CursorState.Initialized)
                {
                    State = CursorState.Moving;
                }
                State = CursorState.Moving;
                return(true);
            }
            return(false);
        }