internal static PropertyItem CreatePropertyItem(IPropertyDefinition pd)
        {
            PropertyItem propertyItem = new PropertyItem();

            var descriptorBase = pd as DescriptorPropertyDefinitionBase;

            propertyItem.PropertyDescriptor = (descriptorBase != null) ? descriptorBase.GetPropertyDescriptor() : null;
            propertyItem.Instance           = (descriptorBase != null) ? descriptorBase.PropertyParent.ValueInstance : null;
            PropertyGridUtilities.InitializePropertyItem(propertyItem, pd);
            return(propertyItem);
        }
        internal static PropertyItem CreatePropertyItem(PropertyDescriptor property, IPropertyParent propertyParent)
        {
            DescriptorPropertyDefinition definition = new DescriptorPropertyDefinition(property, propertyParent);

            definition.InitProperties();
            PropertyItem propertyItem = new PropertyItem();

            propertyItem.PropertyDescriptor = property;
            propertyItem.Instance           = propertyParent.ValueInstance;
            PropertyGridUtilities.InitializePropertyItem(propertyItem, definition);
            return(propertyItem);
        }