src/Misc/EFTools/DesignXmlCore/Base/Shell/TreeGridDesignerTreeControl.cs
/// <summary>
///     Factory method for creating the appropriate drop-down control based on the given property descriptor.  Always
///     creates a TypeEditorHost with the TypeEditorHostEditControlStyle.Editable style.
/// </summary>
/// <param name="propertyDescriptor">
///     Property descriptor used to create the drop-down.  If the property descriptor supports a UITypeEditor,
///     that will be used first.  Otherwise, the type converter will be used.
/// </param>
/// <param name="instance">Instance of the object being edited.</param>
/// <returns>A DropDownControl 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.  Always
creates a TypeEditorHost with the TypeEditorHostEditControlStyle.Editable style.
Factory method for creating the appropriate drop - down control based on the given property descriptor . Always creates a TypeEditorHost with the TypeEditorHostEditControlStyle . Editable style .
internal static TypeEditorHost CreateTypeEditorHost(PropertyDescriptor propertyDescriptor, object instance)
        {
            TypeEditorHost dropDown = null;
            if (propertyDescriptor != null)
            {
                var uiTypeEditor = propertyDescriptor.GetEditor(typeof(UITypeEditor)) as UITypeEditor;
                if (uiTypeEditor != null) 
                {
                    dropDown = new TreeGridDesignerInPlaceEditDropDown(uiTypeEditor, propertyDescriptor, instance);
                }
                else
                {
                    var converter = propertyDescriptor.Converter;
                    if (converter != null
                        && converter.GetStandardValuesSupported(null)) 
                    {
                        dropDown = new TreeGridDesignerInPlaceEditCombo(converter, propertyDescriptor, instance);
                    }
                }
            }
            return dropDown;
        }
internal static TypeEditorHost CreateTypeEditorHost ( PropertyDescriptor propertyDescriptor , object instance ) { TypeEditorHost dropDown = null ; if ( propertyDescriptor != null ) { var uiTypeEditor = propertyDescriptor . GetEditor ( typeof ( UITypeEditor ) ) as UITypeEditor ; if ( uiTypeEditor != null ) { dropDown = new TreeGridDesignerInPlaceEditDropDown ( uiTypeEditor , propertyDescriptor , instance ) ; } else { var converter = propertyDescriptor . Converter ; if ( converter != null && converter . GetStandardValuesSupported ( null ) ) { dropDown = new TreeGridDesignerInPlaceEditCombo ( 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 DropDownControl instance if the given property descriptor supports it, null otherwise.
A DropDownControl instance if the given property descriptor supports it null otherwise .
propertyDescriptor
PropertyDescriptor
Property descriptor used to create the drop-down.  If the property descriptor supports a UITypeEditor,
that will be used first.  Otherwise, the type converter will be used.
Property descriptor used to create the drop - down . If the property descriptor supports a UITypeEditor that will be used first . Otherwise the type converter will be used .
instance
object
Instance of the object being edited.
Instance of the object being edited .