customtypedescriptor

How to get all properties of an object and its sub objects

Hi, I have a similar question to this one except I need to loop all the sub objects and change the property to read-only Please check my code below. This one loop only the main object. When I tried to loop its sub objects, I got an overflow. Thanks. Public Class ReadOnlyTypeDescriptor Inherits CustomTypeDescriptor Priva...

ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor

I'm trying to get an overall understanding of how you use ICustomTypeDescriptor, TypeDescriptionProvider, TypeConverter, and UITypeEditor to change how a PropertyGrid displays and interfaces with an object. Can someone tell me if this is right, or if I missed any major concepts or points? I'm really just trying to understand why and whe...

TypeDescriptionProvider.GetTypeDescriptor() instance parameter is null?

I'm trying to enable user of my application to add their own custom properties to objects. Classes which the user can add properties too implement the interface IUserPropertyHost, which is shown below. UserPropertyHostType is an enumeration that identifies a specific group of custom properties to apply to the object. public interface IU...

How can I avoid having a separate custom TypeDescriptorProvider for each of my classes?

I've added functionality to my project that allows the users to add their own custom properties to objects. I've created my own custom TypeDescriptor, PropertyDescriptor and TypeDescriptorProviders etc.. etc.. to do this. Here's my problem. Right now I have it all working, but had to create a separate TypeDescriptionProvider for each o...

Custom TypeDescriptionProvider works for one type but not another

I'm using a custom TypeDescriptionProvider and a custom TypeDescriptor to allow users to attribute objects with their own custom properties. For example I have two classes which are sometimes displayed in a PropertyGrid SiteRegion, and FootPrintBuilding. Each is attributed with my custom TypeDescriptionProvider. [TypeDescriptionProvider...

ICustomTypeDescriptor for simulating strong-typing

I thought about simulating strong-typing for key-value configuration of a new project by providing fake property info via implementing ICustomTypeDescriptor. The configuration instance should provide all default config keys as properties with default values however: I noticed that VS08 intellisense doesn't include "faked" properties whi...