public static CodeCompletionKeyHandler Attach(IntellisenseEditor mainForm, TextEditorControl editor) { CodeCompletionKeyHandler h = new CodeCompletionKeyHandler(mainForm, editor); editor.ActiveTextAreaControl.TextArea.KeyEventHandler += h.TextAreaKeyEventHandler; // When the editor is disposed, close the code completion window editor.Disposed += h.CloseCodeCompletionWindow; return(h); }
public IntellisenseEditor() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); textEditorControl1.SetHighlighting(Language); textEditorControl1.ShowEOLMarkers = false; CodeCompletionKeyHandler.Attach(this, textEditorControl1); HostCallbackImplementation.Register(this); pcRegistry = new Dom.ProjectContentRegistry(); // Default .NET 2.0 registry // Persistence caches referenced project contents for faster loading. // It also activates loading XML documentation files and caching them // for faster loading and lower memory usage. pcRegistry.ActivatePersistence(Path.Combine(Path.GetTempPath(), "CSharpCodeCompletion")); myProjectContent = new Dom.DefaultProjectContent(); myProjectContent.Language = Dom.LanguageProperties.CSharp; }