Inheritance: System.ComponentModel.PropertyDescriptor
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            List <EffectPropertyDescriptor> newProps = new List <EffectPropertyDescriptor>();

            for (int i = 0; i < mEffect.Parameters.Count; i++)
            {
                List <Attribute> attrs = new List <Attribute>();

                if (mEffect.Parameters[i].ParameterType == EffectParameterType.Texture)
                {
                    attrs.Add(new EditorAttribute(
                                  typeof(System.Windows.Forms.Design.FileNameEditor),
                                  typeof(System.Drawing.Design.UITypeEditor)));
                }

                attrs.AddRange(attributes);

                EffectPropertyDescriptor newPropDesc = new EffectPropertyDescriptor(
                    mEffect.Parameters[i], attrs.ToArray());
                if (newPropDesc.IsBrowsable)
                {
                    newProps.Add(newPropDesc);
                }
            }

            return(new PropertyDescriptorCollection(newProps.ToArray()));
        }
Ejemplo n.º 2
0
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            List<EffectPropertyDescriptor> newProps = new List<EffectPropertyDescriptor>();
            for (int i = 0; i < mEffect.Parameters.Count; i++)
            {
                List<Attribute> attrs = new List<Attribute>();

                if (mEffect.Parameters[i].ParameterType == EffectParameterType.Texture)
                {
                    attrs.Add(new EditorAttribute(
                        typeof(System.Windows.Forms.Design.FileNameEditor),
                        typeof(System.Drawing.Design.UITypeEditor)));
                }

                attrs.AddRange(attributes);

                EffectPropertyDescriptor newPropDesc = new EffectPropertyDescriptor(
                    mEffect.Parameters[i], attrs.ToArray());
                if (newPropDesc.IsBrowsable) newProps.Add(newPropDesc);
            }

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