Example #1
0
 public void ShowIntellisense()
 {
     m_IntellisenseManager.ShowIntellisenseBox();
 }
Example #2
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            #region Show Intellisense
            if (e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z)
            {
                m_IntellisenseManager.ShowIntellisenseBox();
                e.Handled = true;
                this.Focus();
                return;
            }
            #endregion

            if (mp_IntellisenseBox.Visible)
            {
                #region ESCAPE and SPACE - Hide Intellisense
                if (e.KeyCode == Keys.Escape)
                {
                    m_IntellisenseManager.HideIntellisenseBox();
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.Space)
                {
                    m_IntellisenseManager.HideIntellisenseBox();
                    e.Handled = true;
                }
                #endregion

                #region Navigation - Up, Down, PageUp, PageDown, Home, End
                else if (e.KeyCode == Keys.Up)
                {
                    m_IntellisenseManager.NavigateUp(1);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.Down)
                {
                    m_IntellisenseManager.NavigateDown(1);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.PageUp)
                {
                    m_IntellisenseManager.NavigateUp(10);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.PageDown)
                {
                    m_IntellisenseManager.NavigateDown(10);
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.Home)
                {
                    m_IntellisenseManager.NavigateHome();
                    e.Handled = true;
                }
                else if (e.KeyCode == Keys.End)
                {
                    m_IntellisenseManager.NavigateEnd();
                    e.Handled = true;
                }
                #endregion

                #region Typing - Back
                else if (e.KeyCode == Keys.Back)
                {
                    m_IntellisenseManager.TypeBackspace();
                }
                #endregion

                #region Typing - Brackets
                else if (e.KeyCode == Keys.D9)
                {
                    // Trap the open bracket key, displaying a cheap and
                    // cheerful tooltip if the word just typed is in our tree
                    // (the parameters are stored in the tag property of the node)
                }
                else if (e.KeyCode == Keys.D8)
                {
                    // Close bracket key, hide the tooltip textbox
                }
                #endregion

                #region Typing - TAB and Enter
                else if (e.KeyCode == Keys.Tab)
                {
                    m_IntellisenseManager.ConfirmIntellisense();
                    e.Handled          = true;
                    e.SuppressKeyPress = true;
                }
                else if (e.KeyCode == Keys.Enter)
                {
                    m_IntellisenseManager.ConfirmIntellisense();
                    e.Handled = true;
                }
                #endregion
            }

            this.Focus();
            base.OnKeyDown(e);
        }