public static DynamicCustomTypeDescriptor Install(object instance)
 {
     var parentProvider = TypeDescriptor.GetProvider(instance);
     var parentCtd = parentProvider.GetTypeDescriptor(instance);
     var ourCtd = new DynamicCustomTypeDescriptor(parentCtd, instance);
     var ourProvider = new CustomTypeDescriptionProvider(parentProvider, ourCtd);
     TypeDescriptor.AddProvider(ourProvider, instance);
     return ourCtd;
 }
示例#2
0
        public static DynamicCustomTypeDescriptor Install(object instance)
        {
            var parentProvider = TypeDescriptor.GetProvider(instance);
            var parentCtd      = parentProvider.GetTypeDescriptor(instance);
            var ourCtd         = new DynamicCustomTypeDescriptor(parentCtd, instance);
            var ourProvider    = new CustomTypeDescriptionProvider(parentProvider, ourCtd);

            TypeDescriptor.AddProvider(ourProvider, instance);
            return(ourCtd);
        }