Exemplo n.º 1
0
        /// <summary>
        ///     Returns a custom type descriptor suitable for querying about "extended"
        ///     properties.  Extended properties are are attached properties in our world.
        /// </summary>
        public override ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance)
        {
            ICustomTypeDescriptor descriptor = base.GetExtendedTypeDescriptor(instance);

            // It is possible that a Type object worked its way in here as an instance.
            // If it did, we don't need our own descriptor because we don't support
            // attached properties on type instances.

            if (instance != null && !(instance is Type))
            {
                descriptor = new APCustomTypeDescriptor(descriptor, instance);
            }

            return(descriptor);
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Returns a custom type descriptor suitable for querying about "extended"
        ///     properties.  Extended properties are are attached properties in our world.
        /// </summary>
        public override ICustomTypeDescriptor GetExtendedTypeDescriptor(object instance) 
        {
            ICustomTypeDescriptor descriptor = base.GetExtendedTypeDescriptor(instance);

            // It is possible that a Type object worked its way in here as an instance.
            // If it did, we don't need our own descriptor because we don't support
            // attached properties on type instances.

            if (instance != null && !(instance is Type)) 
            {
                descriptor = new APCustomTypeDescriptor(descriptor, instance);
            }

            return descriptor;
        }