示例#1
0
 private void Editor_KeyTyping(object sender, KeyTypingEventArgs e)
 {
     if ((e.KeyData & Keys.KeyCode) == Keys.Tab && ((e.KeyData & Keys.Modifiers) == Keys.Control || (e.KeyData & Keys.Modifiers) == (Keys.Shift | Keys.Control)))
     {
         e.Cancel = true;
         this.windowService.ShowSwitchToDialog();
     }
     if ((e.KeyData & Keys.Modifiers & Keys.Control) != Keys.Control)
     {
         return;
     }
     this.HideIntellisensePrompt();
 }
 protected override void OnSyntaxEditorKeyTyping(SyntaxEditor syntaxEditor, KeyTypingEventArgs e)
 {
     if (e.Command is IndentCommand && this.isPotentiallyAddingEvent)
     {
         e.Cancel = true;
         this.ProcessTabKey(syntaxEditor);
         this.UpdateInternalState(syntaxEditor);
     }
     else
     {
         this.UpdateInternalState(syntaxEditor);
         base.OnSyntaxEditorKeyTyping(syntaxEditor, e);
     }
 }
示例#3
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();
        }
        protected override void OnKeyTyping(KeyTypingEventArgs e)
        {
            base.OnKeyTyping(e);

            if (e.Cancel)
            {
                return;
            }

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

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

                _find_replace_form.Show();
            }
        }
示例#6
0
        /// <summary>
        /// Occurs before a key is typed.
        /// </summary>
        private void EditorKeyTyping(object sender, KeyTypingEventArgs e)
        {
            var editor = sender as ActiproSoftware.SyntaxEditor.SyntaxEditor;
            if (editor == null)
                return;

            // Add status message
            // this.WriteLine("KeyTyping: " + e.ToString());

            if (e.KeyChar != '(')
                return;

            // Get the offset
            var offset = editor.SelectedView.Selection.EndOffset;

            // Get the text stream
            var stream = editor.Document.GetTextStream(offset);

            // Get the language
            var language = stream.Token.Language;

            // If in C#...
            if ((!(language is DynamicSyntaxLanguage)) || (language.Key != "C#"))
                return;

            if ((offset < 10) || (editor.Document.GetSubstring(offset - 10, 10) != "Invalidate"))
                return;

            // Show parameter info
            editor.IntelliPrompt.ParameterInfo.Info.Clear();
            editor.IntelliPrompt.ParameterInfo.Info.Add(@"void <b>Control.Invalidate</b>()<br/>" +
                                                        @"Invalidates the entire surface of the control and causes the control to be redrawn.");
            editor.IntelliPrompt.ParameterInfo.Info.Add(
                @"void Control.Invalidate(<b>System.Drawing.Rectangle rc</b>, bool invalidateChildren)<br/>" +
                @"<b>rc:</b> A System.Drawing.Rectangle object that represents the region to invalidate.");
            editor.IntelliPrompt.ParameterInfo.Show(offset - 10);
        }