Ejemplo n.º 1
0
        private void GetChildProperties()
        {
            if (Value == null)
            {
                return;
            }

            var propertyItems = new List <PropertyItem>();

            try
            {
                PropertyDescriptorCollection descriptors = PropertyGridUtilities.GetPropertyDescriptors(Value);

                foreach (PropertyDescriptor descriptor in descriptors)
                {
                    if (descriptor.IsBrowsable)
                    {
                        propertyItems.Add(PropertyGridUtilities.CreatePropertyItem(descriptor, Instance, PropertyGrid, String.Format("{0}.{1}", BindingPath, descriptor.Name), Level + 1));
                    }
                }
            }
            catch (Exception ex)
            {
                //TODO: handle this some how
            }

            Properties = PropertyGridUtilities.GetAlphabetizedProperties(propertyItems);
        }
Ejemplo n.º 2
0
        private void LoadProperties(bool isCategorized)
        {
            if (_propertyItemsCache == null)
            {
                return;
            }

            //clear any filters first
            Filter = String.Empty;

            if (isCategorized)
            {
                Properties = PropertyGridUtilities.GetCategorizedProperties(_propertyItemsCache);
            }
            else
            {
                Properties = PropertyGridUtilities.GetAlphabetizedProperties(_propertyItemsCache);
            }
        }