src/Misc/EFTools/DesignXmlCore/VirtualTreeGrid/DropDownControl.cs
/// <summary>
///     Factory method for creating the appropriate drop-down control based on the given property descriptor
/// </summary>
/// <param name="propertyDescriptor">A property descriptor describing the property being set</param>
/// <param name="instance">The object instance being edited</param>
/// <returns>A TypeEditorHost instance if the given property descriptor supports it, null otherwise.</returns>
Factory method for creating the appropriate drop-down control based on the given property descriptor
Factory method for creating the appropriate drop - down control based on the given property descriptor
public static TypeEditorHost Create(PropertyDescriptor propertyDescriptor, object instance)
        {
            TypeEditorHost dropDown = null;
            if (propertyDescriptor != null)
            {
                var uiTypeEditor = propertyDescriptor.GetEditor(typeof(UITypeEditor)) as UITypeEditor;
                if (uiTypeEditor != null) 
                {
                    dropDown = new TypeEditorHost(uiTypeEditor, propertyDescriptor, instance);
                }
                else
                {
                    var converter = propertyDescriptor.Converter;
                    if (converter != null
                        && converter.GetStandardValuesSupported(null)) 
                    {
                        dropDown = new TypeEditorHostListBox(converter, propertyDescriptor, instance);
                    }
                }
            }
            return dropDown;
        }
public static TypeEditorHost Create ( PropertyDescriptor propertyDescriptor , object instance ) { TypeEditorHost dropDown = null ; if ( propertyDescriptor != null ) { var uiTypeEditor = propertyDescriptor . GetEditor ( typeof ( UITypeEditor ) ) as UITypeEditor ; if ( uiTypeEditor != null ) { dropDown = new TypeEditorHost ( uiTypeEditor , propertyDescriptor , instance ) ; } else { var converter = propertyDescriptor . Converter ; if ( converter != null && converter . GetStandardValuesSupported ( null ) ) { dropDown = new TypeEditorHostListBox ( converter , propertyDescriptor , instance ) ; } } } return dropDown ; }
Factory method for creating the appropriate drop-down control based on the given property descriptor
Factory method for creating the appropriate drop - down control based on the given property descriptor
// UITypeEditor case // converter case
A TypeEditorHost instance if the given property descriptor supports it, null otherwise.
A TypeEditorHost instance if the given property descriptor supports it null otherwise .
propertyDescriptor
PropertyDescriptor
A property descriptor describing the property being set
A property descriptor describing the property being set
instance
object
The object instance being edited
The object instance being edited