MoveFirst() публичный Метод

public MoveFirst ( ) : void
Результат void
Пример #1
0
        protected void HandleKeyboard()
        {
            Event evt = Event.current;

            if (evt.GetTypeForControl(m_ControlID) != EventType.KeyDown ||
                m_ControlID != GUIUtility.keyboardControl)
            {
                return;
            }

            if (m_MemorySelection.Selected == null)
            {
                return;
            }

            int count;

            switch (evt.keyCode)
            {
            case KeyCode.UpArrow:
                m_MemorySelection.MoveUp();
                break;

            case KeyCode.DownArrow:
                m_MemorySelection.MoveDown();
                break;

            case KeyCode.Home:
                m_MemorySelection.MoveFirst();
                break;

            case KeyCode.End:
                m_MemorySelection.MoveLast();
                break;

            case KeyCode.LeftArrow:
                if (m_MemorySelection.Selected.expanded)
                {
                    m_MemorySelection.Selected.expanded = false;
                }
                else
                {
                    m_MemorySelection.MoveParent();
                }
                break;

            case KeyCode.RightArrow:
                if (m_MemorySelection.Selected.ChildCount() > 0)
                {
                    m_MemorySelection.Selected.expanded = true;
                }
                break;

            case KeyCode.PageUp:
                count = Mathf.RoundToInt(m_VisibleHeight / kRowHeight);
                for (int i = 0; i < count; i++)
                {
                    m_MemorySelection.MoveUp();
                }
                break;

            case KeyCode.PageDown:
                count = Mathf.RoundToInt(m_VisibleHeight / kRowHeight);
                for (int i = 0; i < count; i++)
                {
                    m_MemorySelection.MoveDown();
                }
                break;

            case KeyCode.Return:
                if (m_MemorySelection.Selected.memoryInfo != null)
                {
                    Selection.instanceIDs      = new int[0];
                    Selection.activeInstanceID = m_MemorySelection.Selected.memoryInfo.instanceId;
                }
                break;

            default:
                return;
            }
            RowClicked(evt, m_MemorySelection.Selected);
            EnsureVisible();
            m_ProfilerWindow.Repaint();
        }