Example #1
0
        public void CustomExpandableConverterTest()
        {
            PropertyGrid pg = new PropertyGrid();

            var rootObj = new ConverterTestRootObject();

            pg.SelectedObject = rootObj;

            GridItem customExpandableGridItem = pg.GetRootItem();

            Assert.AreEqual("CustomExpandableProperty", customExpandableGridItem.Label);

            var substitutedGridItems = customExpandableGridItem.GridItems;

            Assert.AreEqual(1, substitutedGridItems.Count);
            Assert.NotNull(substitutedGridItems["SomeProperty"]);
        }
Example #2
0
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, object value, Attribute[] attributes)
        {
            ConverterTestRootObject testObject = context.Instance as ConverterTestRootObject;

            return(TypeDescriptor.GetProperties(testObject.propertiesHolder));
        }