Ejemplo n.º 1
0
        /// <summary>
        /// Gets a collection of properties for the type of object specified by the value parameter.
        /// </summary>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that provides a format context.</param>
        /// <param name="value">An <see cref="T:System.Object"/> that specifies the type of object to get the properties for.</param>
        /// <param name="attributes">An array of type <see cref="T:System.Attribute"/> that will be used as a filter.</param>
        /// <returns>
        /// A <see cref="T:System.ComponentModel.PropertyDescriptorCollection"/> with the properties that are exposed for the component, or null if there are no properties.
        /// </returns>
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, Object value, Attribute[] attributes)
        {
            return(new PropertyDescriptorCollection(new PropertyDescriptor[]
            {
                PropertyDescriptorFactory.Create(RangeType.GetField("Minimum"),
                                                 new DescriptionAttribute("Gets or sets the inclusive minimum value in the range.")),

                PropertyDescriptorFactory.Create(RangeType.GetField("Maximum"),
                                                 new DescriptionAttribute("Gets or sets the inclusive maximum value in the range."))
            }));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets a collection of properties for the type of object specified by the value parameter.
        /// </summary>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that provides a format context.</param>
        /// <param name="value">An <see cref="T:System.Object"/> that specifies the type of object to get the properties for.</param>
        /// <param name="attributes">An array of type <see cref="T:System.Attribute"/> that will be used as a filter.</param>
        /// <returns>
        /// A <see cref="T:System.ComponentModel.PropertyDescriptorCollection"/> with the properties that are exposed for the component, or null if there are no properties.
        /// </returns>
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, Object value, Attribute[] attributes)
        {
            return(new PropertyDescriptorCollection(new PropertyDescriptor[]
            {
                PropertyDescriptorFactory.Create(RangeType.GetField("Red"),
                                                 new DescriptionAttribute("Gets or sets the red component of the colour range.")),

                PropertyDescriptorFactory.Create(RangeType.GetField("Green"),
                                                 new DescriptionAttribute("Gets or sets the green component of the colour range.")),

                PropertyDescriptorFactory.Create(RangeType.GetField("Blue"),
                                                 new DescriptionAttribute("Gets or sets the green component of the colour range."))
            }));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets a collection of properties for the type of object specified by the value parameter.
        /// </summary>
        /// <param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext"/> that provides a format context.</param>
        /// <param name="value">An <see cref="T:System.Object"/> that specifies the type of object to get the properties for.</param>
        /// <param name="attributes">An array of type <see cref="T:System.Attribute"/> that will be used as a filter.</param>
        /// <returns>
        /// A <see cref="T:System.ComponentModel.PropertyDescriptorCollection"/> with the properties that are exposed for the component, or null if there are no properties.
        /// </returns>
        public override PropertyDescriptorCollection GetProperties(ITypeDescriptorContext context, Object value, Attribute[] attributes)
        {
            return(new PropertyDescriptorCollection(new PropertyDescriptor[]
            {
                PropertyDescriptorFactory.Create(RangeType.GetField("Yaw"),
                                                 new DescriptionAttribute("Gets or sets the yaw component of the rotation range.")),

                PropertyDescriptorFactory.Create(RangeType.GetField("Pitch"),
                                                 new DescriptionAttribute("Gets or sets the pitch component of the rotation range.")),

                PropertyDescriptorFactory.Create(RangeType.GetField("Roll"),
                                                 new DescriptionAttribute("Gets or sets the roll component of the rotation range."))
            }));
        }
        /// <summary>
        /// Returns a collection of property descriptors for the object represented by this type descriptor.
        /// </summary>
        /// <returns>
        /// A <see cref="T:System.ComponentModel.PropertyDescriptorCollection"/> containing the property descriptions for the object represented by this type descriptor. The default is <see cref="F:System.ComponentModel.PropertyDescriptorCollection.Empty"/>.
        /// </returns>
        public override PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            return(new PropertyDescriptorCollection(new PropertyDescriptor[]
            {
                PropertyDescriptorFactory.Create(ParticleEffectType.GetProperty("Name"),
                                                 new CategoryAttribute("Particle Effect"),
                                                 new DescriptionAttribute("The name of the particle effect.")),

                PropertyDescriptorFactory.Create(ParticleEffectType.GetProperty("Author"),
                                                 new CategoryAttribute("Particle Effect"),
                                                 new DescriptionAttribute("The author of the particle effect.")),

                PropertyDescriptorFactory.Create(ParticleEffectType.GetProperty("Description"),
                                                 new CategoryAttribute("Particle Effect"),
                                                 new DescriptionAttribute("The description of the ParticleEffect.")),
            }));
        }