Ejemplo n.º 1
0
        protected override void OnKeyTyping(KeyTypingEventArgs e)
        {
            base.OnKeyTyping(e);

            if (e.Cancel)
            {
                return;
            }

            if (e.KeyData == (Keys.F1))
            {
                new ShortcutHelp().Show();
            }

            if (e.KeyData == (Keys.Control | Keys.F))
            {
                if (_find_replace_form == null)
                {
                    _find_replace_form = new FindReplaceForm(this, new FindReplaceOptions());
                    //_find_replace_form.StatusChanged += new FindReplaceStatusChangeEventHandler(findReplaceForm_StatusChanged);
                }

                if (TopLevelControl is Form)
                {
                    _find_replace_form.Owner = TopLevelControl as Form;
                }

                _find_replace_form.Show();
            }

            if (e.KeyData == (Keys.Shift | Keys.Control | Keys.F))
            {
                if (Document.Language.FormattingSupported)
                {
                    bool origin = Document.ReadOnly;
                    Document.ReadOnly = false;
                    Document.Language.FormatDocument(Document);
                    Document.ReadOnly = origin;
                }
            }

            if (e.KeyData == (Keys.F5))
            {
                new XPathEvaluatorForm(Text).ShowDialog();
            }
        }
        protected override void OnKeyTyping(KeyTypingEventArgs e)
        {
            base.OnKeyTyping(e);

            if (e.Cancel) return;

            if (e.KeyData == (Keys.F1))
                new ShortcutHelp().Show();

            if (e.KeyData == (Keys.Control | Keys.F))
            {
                if (_find_replace_form == null)
                {
                    _find_replace_form = new FindReplaceForm(this, new FindReplaceOptions());
                    //_find_replace_form.StatusChanged += new FindReplaceStatusChangeEventHandler(findReplaceForm_StatusChanged);
                }

                if (TopLevelControl is Form)
                    _find_replace_form.Owner = TopLevelControl as Form;

                _find_replace_form.Show();
            }

            if (e.KeyData == (Keys.Shift | Keys.Control | Keys.F))
            {
                if (Document.Language.FormattingSupported)
                {
                    bool origin = Document.ReadOnly;
                    Document.ReadOnly = false;
                    Document.Language.FormatDocument(Document);
                    Document.ReadOnly = origin;
                }
            }

            if (e.KeyData == (Keys.F5))
                new XPathEvaluatorForm(Text).ShowDialog();
        }