using System;
using System.ComponentModel;
namespace AnticipatingMinds.PlatformServices.Configuration{
/// <summary>
/// Summary description for ConfigurationPropertyDescription.
/// </summary>
public class ConfigurationPropertyDescription : PropertyDescriptor
{
public ConfigurationPropertyDescription(PropertyDescriptor aggregatedPropertyDescriptotInstance):base(aggregatedPropertyDescriptotInstance)
{
this.aggregatedPropertyDescriptotInstance = aggregatedPropertyDescriptotInstance;
}
public override bool CanResetValue(object component)
{
return aggregatedPropertyDescriptotInstance.CanResetValue(component);
}
public override object GetValue(object component)
{
return aggregatedPropertyDescriptotInstance.GetValue(component);
}
public override void SetValue(object component, object value)
{
aggregatedPropertyDescriptotInstance.SetValue(component,value);
}
public override bool IsReadOnly
{
get
{
return aggregatedPropertyDescriptotInstance.IsReadOnly;
}
}
public override Type ComponentType
{
get
{
return aggregatedPropertyDescriptotInstance.ComponentType;
}
}
public override Type PropertyType
{
get
{
return aggregatedPropertyDescriptotInstance.PropertyType;
}
}
public override void ResetValue(object component)
{
aggregatedPropertyDescriptotInstance.ResetValue(component);
}
public override bool ShouldSerializeValue(object component)
{
return aggregatedPropertyDescriptotInstance.ShouldSerializeValue(component);
}
public override string DisplayName
{
get
{
foreach(Attribute attribute in Attributes)
if(attribute is DisplayNameAttribute)
return (attribute as DisplayNameAttribute).DisplayName;
return base.DisplayName;
}
}
private PropertyDescriptor aggregatedPropertyDescriptotInstance;
}
}
|