SetComponentType() public method

public SetComponentType ( Type componentType ) : void
componentType System.Type
return void
        public static PropertyDescriptorCollection AddProperty(PropertyDescriptorCollection pdc, string propertyName, Type propertyType, TypeConverter converter,
                                                               Attribute[] attributes, MemberChangeEventHandler eventArgs, Func <object> getMember)
        {
            List <PropertyDescriptor> properties = new List <PropertyDescriptor>(pdc.Count);

            for (int i = 0; i < pdc.Count; i++)
            {
                PropertyDescriptor pd = pdc[i];

                if (pd.Name != propertyName)
                {
                    properties.Add(pd);
                }
            }

            // If it doesn't have
            // events for getting and
            // setting the value, then
            // the variable is part of the
            // type itself.  Objects can't have
            // fields/properties with spaces in them
            // so this is an invalid property.  The name
            // is either wrong or the user should have passed
            // in get and set methods.
            if (propertyName.Contains(' ') && (getMember == null || eventArgs == null))
            {
                throw new ArgumentException("The member cannot have spaces in the name if it doesn't have getters and setters explicitly set");
            }

            ReflectingParameterDescriptor epd = new ReflectingParameterDescriptor(propertyName, attributes);

            epd.SetComponentType(propertyType);
            epd.Instance          = CurrentInstance;
            epd.MemberChangeEvent = eventArgs as MemberChangeEventHandler;
            epd.CustomGetMember   = getMember;
            epd.TypeConverter     = converter;



            properties.Add(epd);

            //PropertyDescriptor propertyDescriptor;

            return(new PropertyDescriptorCollection(properties.ToArray()));
        }
		public static PropertyDescriptorCollection AddProperty(PropertyDescriptorCollection pdc, string propertyName, Type propertyType, TypeConverter converter,
            Attribute[] attributes, MemberChangeEventHandler eventArgs, Func<object> getMember)
        {
            List<PropertyDescriptor> properties = new List<PropertyDescriptor>(pdc.Count);

            for (int i = 0; i < pdc.Count; i++)
            {
                PropertyDescriptor pd = pdc[i];

                if (pd.Name != propertyName)
                {
                    properties.Add(pd);
                }
            }

            // If it doesn't have
            // events for getting and
            // setting the value, then
            // the variable is part of the
            // type itself.  Objects can't have
            // fields/properties with spaces in them
            // so this is an invalid property.  The name
            // is either wrong or the user should have passed
            // in get and set methods.
            if (propertyName.Contains(' ') && (getMember == null || eventArgs == null))
            {
                throw new ArgumentException("The member cannot have spaces in the name if it doesn't have getters and setters explicitly set");
            }

            ReflectingParameterDescriptor epd = new ReflectingParameterDescriptor(propertyName, attributes);
            epd.SetComponentType(propertyType);
            epd.Instance = CurrentInstance;
            epd.MemberChangeEvent = eventArgs as MemberChangeEventHandler;
            epd.CustomGetMember = getMember;
            epd.TypeConverter = converter;
                


            properties.Add(epd);            

            //PropertyDescriptor propertyDescriptor;

            return new PropertyDescriptorCollection(properties.ToArray());
             
        }