aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.Editors/Intellisense/NamespaceCompletionItem.cs
blob: d5c8db38a4dc866e991094679cf5cc3cb82d93b8 (plain)
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Media.Imaging;

namespace Tango.Scripting.Editors.Intellisense
{
    public class NamespaceCompletionItem : CompletionItem
    {
        private static BitmapSource image = GetImage("namespace.png");

        public override string Text => Name;
        public override CompletionItemPopupControl PopupControl => new NamespaceCompletionItemPopup();
        public override BitmapSource Image => image;

        public String Name { get; set; }
        public String Assembly { get; set; }

        public override void Complete(ScriptEditor editor)
        {
            var line = editor.GetCurrentLine();
            editor.Document.Replace(line, "using " + Name);
        }
    }
}