Bonjours,
Je suis entrain de crée un Editor avec la base du "ICsharp.textEditor".
Je souhaiterai ajouté un "CodeCompletion" mais je n'arrive pas
Est-ce que quelqu'un pourrait m'aidé?
Bonjours,
Je suis entrain de crée un Editor avec la base du "ICsharp.textEditor".
Je souhaiterai ajouté un "CodeCompletion" mais je n'arrive pas
Est-ce que quelqu'un pourrait m'aidé?
Voila ce que j'ai essayer de faire mais sa ne marche pas vraiment... jai une erreur au niveau du "completionDataProvider" mais je voie pas comment je peu écrire cette classe quelqu'un aurait t-il une Idée??
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; using System.IO; using System.Threading; using ICSharpCode.TextEditor; using ICSharpCode.TextEditor.Gui; using ICSharpCode.TextEditor.Gui.CompletionWindow; namespace Editor { class CodeCompletionKeyHandler { FCentral mainForm; TextEditorControl editor; CodeCompletionWindow codeCompletionWindow; private CodeCompletionKeyHandler(FCentral mainForm, TextEditorControl editor) { this.mainForm = mainForm; this.editor = editor; } public static CodeCompletionKeyHandler Attach(FCentral 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; } /// <summary> /// Return true to handle the keypress, return false to let the text area handle the keypress /// </summary> bool TextAreaKeyEventHandler(char key) { if (codeCompletionWindow != null) { // If completion window is open and wants to handle the key, don't let the text area // handle it if (codeCompletionWindow.ProcessKeyEvent(key)) return true; } if (key == '.') { ICompletionDataProvider completionDataProvider = new CodeCompletionProvider(mainForm); codeCompletionWindow = CodeCompletionWindow.ShowCompletionWindow( mainForm, // The parent window for the completion window editor, // The text editor to show the window for @"C:\Users\name.txt", // Filename - will be passed back to the provider completionDataProvider, // Provider to get the list of possible completions key // Key pressed - will be passed to the provider ); if (codeCompletionWindow != null) { // ShowCompletionWindow can return null when the provider returns an empty list codeCompletionWindow.Closed += new EventHandler(CloseCodeCompletionWindow); } } return false; } void CloseCodeCompletionWindow(object sender, EventArgs e) { if (codeCompletionWindow != null) { codeCompletionWindow.Closed -= new EventHandler(CloseCodeCompletionWindow); codeCompletionWindow.Dispose(); codeCompletionWindow = null; } } public ICompletionDataProvider completionDataProvider { get; set; } } }
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager