public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
{
PropertyDescriptorCollection coll = TypeDescriptor.GetProperties(this, attributes, true);
List<PropertyDescriptor> props = new List<PropertyDescriptor>();
string engine = Engine.ToLowerInvariant();
bool engineIsMyIsam = engine == "myisam";
foreach (PropertyDescriptor pd in coll)
{
if (!pd.IsBrowsable) continue;
if (pd.Name == "DataDirectory" || pd.Name == "IndexDirectory")
{
CustomPropertyDescriptor newPd = new CustomPropertyDescriptor(pd);
newPd.SetReadOnly(!engineIsMyIsam);
props.Add(newPd);
}
else if ((pd.Name == "DelayKeyWrite" || pd.Name == "CheckSum" || pd.Name == "PackKeys") &&
!engineIsMyIsam)
{
}
else if (pd.Name == "InsertMethod" && engine != "mrg_myisam") { }
else
props.Add(pd);
}
return new PropertyDescriptorCollection(props.ToArray());
}