protected override void PreFilterProperties(IDictionary properties)
{
// Let base clas filter properties first
base.PreFilterProperties(properties);
// Remove the design time properties we do not want
properties.Remove("Modifiers");
properties.Remove("Locked");
properties.Remove("GenerateMember");
// Scan for the 'Name' propertty
foreach (DictionaryEntry entry in properties)
{
// Get the property descriptor for the entry
PropertyDescriptor descriptor = (PropertyDescriptor)entry.Value;
// Is this the 'Name' we are searching for?
if (descriptor.Name.Equals("Name") && descriptor.DesignTimeOnly)
{
// Hide the 'Name' property so the user cannot modify it
Attribute[] attributeArray = new Attribute[2] { BrowsableAttribute.No, DesignerSerializationVisibilityAttribute.Hidden };
properties[entry.Key] = TypeDescriptor.CreateProperty(descriptor.ComponentType, descriptor, attributeArray);
// Finished
break;
}
}
}