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 || mEffect.Parameters[i].ParameterType == EffectParameterType.Texture2D) { 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())); }
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 || mEffect.Parameters[i].ParameterType == EffectParameterType.Texture2D) { 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()); }