// In the future, we may want to add Color, Date, etc.
private bool CanEditProperty(PropertyDescriptor property)
{
// Don't show readonly properties
if (property.IsReadOnly)
{
return(false);
}
// Don't show Shared personalizable properties in User mode
if (WebPartManager != null &&
WebPartManager.Personalization != null &&
WebPartManager.Personalization.Scope == PersonalizationScope.User)
{
AttributeCollection attributes = property.Attributes;
if (attributes.Contains(PersonalizableAttribute.SharedPersonalizable))
{
return(false);
}
}
// Only show properties that can be converted to/from string
return(Util.CanConvertToFrom(property.Converter, typeof(string)));
}