Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlCompletionData.cs @ 9779

Last change on this file since 9779 was 9674, checked in by gkronber, 12 years ago

#2026: Worked on integration of ICSharpCode.AvalonEdit control for GPDL syntax-highlighting and error reporting.

File size: 1.0 KB
Line 
1using System;
2using ICSharpCode.AvalonEdit.CodeCompletion;
3using ICSharpCode.AvalonEdit.Document;
4using ICSharpCode.AvalonEdit.Editing;
5
6namespace HeuristicLab.Problems.GPDL.Views {
7  /// Implements AvalonEdit ICompletionData interface to provide the entries in the
8  /// completion drop down.
9  public class MyCompletionData : ICompletionData {
10    public MyCompletionData(string text) {
11      this.Text = text;
12    }
13
14    public System.Windows.Media.ImageSource Image {
15      get { return null; }
16    }
17
18    public string Text { get; private set; }
19
20    // Use this property if you want to show a fancy UIElement in the list.
21    public object Content {
22      get { return this.Text; }
23    }
24
25    public object Description {
26      get { return "Description for " + this.Text; }
27    }
28
29    public double Priority { get; private set; }
30
31    public void Complete(TextArea textArea, ISegment completionSegment,
32        EventArgs insertionRequestEventArgs) {
33      textArea.Document.Replace(completionSegment, this.Text);
34    }
35  }
36}
Note: See TracBrowser for help on using the repository browser.