Draw Dorp-Down propertyGrid
[TypeConverter(typeof(backgroundRepeatConverter)),
DescriptionAttribute("description"),
CategoryAttribute("行为")]
public string backgroundRepeat
{
get
{
if(e.style.backgroundRepeat==null)return "";
return e.style.backgroundRepeat;
}
set
{
e.style.backgroundRepeat=value;
}
}
DescriptionAttribute("description"),
CategoryAttribute("行为")]
public string backgroundRepeat
{
get
{
if(e.style.backgroundRepeat==null)return "";
return e.style.backgroundRepeat;
}
set
{
e.style.backgroundRepeat=value;
}
}
public class backgroundRepeatConverter: StringConverter
{
public override StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection(new string[]{"repeat",
"repeat-x",
"repeat-y",
"no-repeat"});
}
public override bool GetStandardValuesSupported(
ITypeDescriptorContext context)
{
return true;
}
public override bool GetStandardValuesExclusive(
ITypeDescriptorContext context)
{
return true;
}
}
{
public override StandardValuesCollection
GetStandardValues(ITypeDescriptorContext context)
{
return new StandardValuesCollection(new string[]{"repeat",
"repeat-x",
"repeat-y",
"no-repeat"});
}
public override bool GetStandardValuesSupported(
ITypeDescriptorContext context)
{
return true;
}
public override bool GetStandardValuesExclusive(
ITypeDescriptorContext context)
{
return true;
}
}