private void ProcessEqualsKey(SyntaxEditor syntaxEditor) { this.resolver = syntaxEditor.Document.LanguageData as DotNetProjectResolver; CSharpExtendedSyntaxLanguage.ForceSynchronousReparse(syntaxEditor.Document); if (!this.IsEventInsertion(syntaxEditor)) { return; } this.isPotentiallyAddingEvent = this.InitializeEventData(); }
private void ProcessTabKey(SyntaxEditor syntaxEditor) { if (!this.isPotentiallyAddingEvent) { return; } if (this.EventInserted != null) { CSharpExtendedSyntaxLanguage.ForceSynchronousReparse(syntaxEditor.Document); DotNetContext context = this.GetContext(syntaxEditor, syntaxEditor.Caret.Offset, false, false); if (context != null) { this.EventInserted((object)this, new InsertEventHandlerEventArgs(this.returnType, this.methodName, this.parameters, this.GetEventConstructor(), context.MemberDeclarationNode.DeclaringType.Resolve(this.resolver))); } } this.isPotentiallyAddingEvent = false; }
private void InitializeEditor(ActiproSoftware.SyntaxEditor.Document document, ICodeProject codeProject) { this.editor.LineNumberMarginVisible = true; this.editor.BracketHighlightingVisible = true; this.editor.IndentationGuidesVisible = true; this.editor.AllowDrag = true; this.editor.AllowDrop = true; this.editor.SplitType = SyntaxEditorSplitType.None; this.editor.IndentType = IndentType.Smart; this.editor.Document = document; if (document != null) { this.editor.Document.SemanticParsingEnabled = true; this.editor.Document.LexicalParsingEnabled = true; } else { this.editor.Enabled = false; } this.SetEditorTheme(); this.editor.ContextMenuRequested += new ContextMenuRequestEventHandler(this.Editor_ContextMenuRequested); this.editor.GotFocus += new EventHandler(this.OnEditorGotFocus); this.editor.LostFocus += new EventHandler(this.OnEditorLostFocus); if (this.editor.Document.Language is CSharpSyntaxLanguage) { this.cSharpLanguage = new CSharpExtendedSyntaxLanguage(codeProject); this.editor.Document.Language = (SyntaxLanguage)this.cSharpLanguage; this.cSharpLanguage.EventInserted += new EventHandler <InsertEventHandlerEventArgs>(this.OnEventInserted); this.editor.IntelliPrompt.QuickInfo.HideOnMouseMove = false; } else if (this.editor.Document.Language.Key.Equals("JScript", StringComparison.OrdinalIgnoreCase)) { this.editor.Document.Language.LineCommentDelimiter = "//"; } this.editor.KeyTyping += new KeyTypingEventHandler(this.Editor_KeyTyping); }