public SharpDevelopCompletionWindow(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 = StringParser.Parse("${res:ICSharpCode.AvalonEdit.AddIn.SharpDevelopCompletionWindow.EmptyText}");
            }

            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;
        }
		public SharpDevelopCompletionWindow(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 = StringParser.Parse("${res:ICSharpCode.AvalonEdit.AddIn.SharpDevelopCompletionWindow.EmptyText}");
			}
			
			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;
			this.EndOffset += itemList.PostselectionLength;
		}