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);
        }