| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Media.Imaging;
- namespace TeamAAS_VP.Core
- {
- /// <summary>
- /// C#成员类型
- /// </summary>
- public enum CoreMemberType
- {
- Field,
- Property,
- Void,
- Event,
- }
- /// <summary>
- /// Implements AvalonEdit ICompletionData interface to provide the entries in the completion drop down.
- /// </summary>
- public class ScriptCompletionData : ICSharpCode.AvalonEdit.CodeCompletion.ICompletionData
- {
- public ScriptCompletionData(string text, CoreMemberType member)
- {
- this.Text = text;
- switch (member)
- {
- case CoreMemberType.Field:
- Image= new BitmapImage(new Uri("/Resources/Images/1field.png", UriKind.Relative));
- break;
- case CoreMemberType.Property:
- Image = new BitmapImage(new Uri("/Resources/Images/2property.png", UriKind.Relative));
- break;
- case CoreMemberType.Void:
- Image = new BitmapImage(new Uri("/Resources/Images/3void.png", UriKind.Relative));
- break;
- case CoreMemberType.Event:
- Image = new BitmapImage(new Uri("/Resources/Images/4event.png", UriKind.Relative));
- break;
- default:
- break;
- }
- }
- public System.Windows.Media.ImageSource Image { get;private set; }
- public string Text { get; private set; }
- // Use this property if you want to show a fancy UIElement in the drop down list.
- public object Content
- {
- get { return this.Text; }
- }
- public object Description
- {
- get { return "Description for " + this.Text; }
- }
- public double Priority { get { return 0; } }
- public void Complete(ICSharpCode.AvalonEdit.Editing.TextArea textArea, ICSharpCode.AvalonEdit.Document.ISegment completionSegment, EventArgs insertionRequestEventArgs)
- {
- textArea.Document.Replace(completionSegment, this.Text);
- }
- }
- }
|