public void AddRange(XmlCompletionItemCollection item)
        {
            if (item == null)
            {
                throw new ArgumentNullException(nameof(item));
            }

            for (var i = 0; i < item.Count; i++)
            {
                if (!Contains(item[i].Text))
                {
                    Add(item[i]);
                }
            }
        }
Ejemplo n.º 2
0
        public XmlCompletionItemCollection GetNamespaceCompletion()
        {
            var completionItems = new XmlCompletionItemCollection();

            foreach (var schema in this)
            {
                var completionItem = new XmlCompletionItem(schema.NamespaceUri, XmlCompletionItemType.NamespaceUri);
                if (!completionItems.Contains(completionItem))
                {
                    completionItems.Add(completionItem);
                }
            }

            return(completionItems);
        }
 public XmlCompletionItemCollection(XmlCompletionItemCollection items)
     : this()
 {
     AddRange(items);
 }
        private void SetCompletionWindowWidth(ICompletionListWindow completionWindow, XmlCompletionItemCollection completionItems)
        {
            var firstListItem = completionItems[0];

            if (firstListItem.DataType == XmlCompletionItemType.NamespaceUri)
            {
                completionWindow.Width = double.NaN;
            }
        }