public class WebCustomControlDesigner : ControlDesigner
{
[
Category("Appearance"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
Description("Sets the Top style attribute."),
]
public string Top
{
get
{
//We may customize the logic here.
return (string)Behavior.GetStyleAttribute("TOP", false, true);
}
set
{
Behavior.SetStyleAttribute("TOP", false, value, true);
((WebControl)Component).Style["TOP"] = value;
}
}
[
Category("Appearance"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
Description("Sets the Left style attribute."),
]
public string Left
{
get
{
return (string)Behavior.GetStyleAttribute("LEFT", false, true);
}
set
{
Behavior.SetStyleAttribute("LEFT", false, value, true);
((WebControl)Component).Style["LEFT"] = value;
}
}
protected override void PreFilterProperties(System.Collections.IDictionary properties)
{
base.PreFilterProperties(properties);
properties["Top"] = TypeDescriptor.CreateProperty(GetType(), "Top", typeof(string));
properties["Left"] = TypeDescriptor.CreateProperty(GetType(), "Left", typeof(string));
}
}
{
[
Category("Appearance"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
Description("Sets the Top style attribute."),
]
public string Top
{
get
{
//We may customize the logic here.
return (string)Behavior.GetStyleAttribute("TOP", false, true);
}
set
{
Behavior.SetStyleAttribute("TOP", false, value, true);
((WebControl)Component).Style["TOP"] = value;
}
}
[
Category("Appearance"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden),
Description("Sets the Left style attribute."),
]
public string Left
{
get
{
return (string)Behavior.GetStyleAttribute("LEFT", false, true);
}
set
{
Behavior.SetStyleAttribute("LEFT", false, value, true);
((WebControl)Component).Style["LEFT"] = value;
}
}
protected override void PreFilterProperties(System.Collections.IDictionary properties)
{
base.PreFilterProperties(properties);
properties["Top"] = TypeDescriptor.CreateProperty(GetType(), "Top", typeof(string));
properties["Left"] = TypeDescriptor.CreateProperty(GetType(), "Left", typeof(string));
}
}