Inheritance: ICompletionData, INotifyPropertyChanged
コード例 #1
0
        public CodeCompletionWindow(ITextEditor editor, TextArea textArea, ICompletionItemList itemList)
            : base(textArea)
        {
            if (editor == null)
                throw new ArgumentNullException("editor");
            if (itemList == null)
                throw new ArgumentNullException("itemList");

            if (!itemList.ContainsAllAvailableItems) {
                // If more items are available (Ctrl+Space wasn't pressed), show this hint
                this.EmptyText = "Press Ctrl+Space to show items from all namespaces";
            }

            //InitializeComponent();
            this.Editor = editor;
            this.itemList = itemList;
            ICompletionItem suggestedItem = itemList.SuggestedItem;
            foreach (ICompletionItem item in itemList.Items) {
                ICompletionData adapter = new CodeCompletionDataAdapter(this, item);
                this.CompletionList.CompletionData.Add(adapter);
                if (item == suggestedItem)
                    this.CompletionList.SelectedItem = adapter;
            }
            this.StartOffset -= itemList.PreselectionLength;
        }
コード例 #2
0
        public CodeCompletionWindow(ITextEditor editor, TextArea textArea, ICompletionItemList itemList) : base(textArea)
        {
            if (editor == null)
            {
                throw new ArgumentNullException("editor");
            }
            if (itemList == null)
            {
                throw new ArgumentNullException("itemList");
            }

            if (!itemList.ContainsAllAvailableItems)
            {
                // If more items are available (Ctrl+Space wasn't pressed), show this hint
                this.EmptyText = "Press Ctrl+Space to show items from all namespaces";
            }

            //InitializeComponent();
            this.Editor   = editor;
            this.itemList = itemList;
            ICompletionItem suggestedItem = itemList.SuggestedItem;

            foreach (ICompletionItem item in itemList.Items)
            {
                ICompletionData adapter = new CodeCompletionDataAdapter(this, item);
                this.CompletionList.CompletionData.Add(adapter);
                if (item == suggestedItem)
                {
                    this.CompletionList.SelectedItem = adapter;
                }
            }
            this.StartOffset -= itemList.PreselectionLength;
        }