1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
5
using System.Collections.Generic;
6
using System.ComponentModel;
7
using System.Drawing.Design;
8
using System.Windows.Forms;
9
using System.Windows.Forms.Design;
10
using ICSharpCode.SharpDevelop.Widgets.DesignTimeSupport;
12
namespace ICSharpCode.WixBinding
14
public class WixDropDownEditor : DropDownEditor
16
protected override Control CreateDropDownControl(ITypeDescriptorContext context, IWindowsFormsEditorService editorService)
18
return new DropDownEditorListBox(editorService, GetDropDownItems(context));
21
IEnumerable<string> GetDropDownItems(ITypeDescriptorContext context)
23
if (context != null) {
24
WixXmlAttributePropertyDescriptor propertyDescriptor = context.PropertyDescriptor as WixXmlAttributePropertyDescriptor;
25
if (propertyDescriptor != null && propertyDescriptor.WixXmlAttribute.HasValues) {
26
return propertyDescriptor.WixXmlAttribute.Values;