private void addPropertyGrid(String cate, String name, Type type, object value, String desc, String[] conv, bool readOnly) { // write the parameter property page automaticly. XProp xprop = new XProp(); xprop.Category = cate; xprop.Name = name; xprop.ProType = type; // typeof(int); typeof(MyComboItemConvert); xprop.Value = value; xprop.Description = desc; xprop.Options = conv; if (conv.Length > 0) { String optStr = ""; for (int i = 0; i < conv.Length; ++i) { optStr = optStr + conv[i]; if (i + 1 < conv.Length) { optStr = optStr + ","; } } xprop.Converter = new MyComboItemConvert(optStr); } xprop.ReadOnly = readOnly; m_PropsParam.Add(xprop); propertyGrid1.SelectedObject = m_PropsParam; }
public XPropDescriptor(XProp prop, Attribute[] attrs) : base(prop.Name, attrs) { theProp = prop; }