namespace System.Web.UI.WebControls
{
- public class SubMenuStyle: Style
+ public class SubMenuStyle: Style, ICustomTypeDescriptor
{
- private static int HORZ_PADD = (0x01 << 16);
- private static int VERT_PADD = (0x01 << 17);
+ const string HORZ_PADD = "HorizontalPadding";
+ const string VERT_PADD = "VerticalPadding";
public SubMenuStyle ()
{
{
}
+ bool IsSet (string v)
+ {
+ return ViewState [v] != null;
+ }
+
[DefaultValue (typeof(Unit), "")]
[NotifyParentProperty (true)]
public Unit HorizontalPadding {
get {
if(IsSet(HORZ_PADD))
- return (Unit)(ViewState["HorizontalPadding"]);
+ return (Unit)(ViewState[HORZ_PADD]);
return Unit.Empty;
}
set {
- ViewState["HorizontalPadding"] = value;
- Set(HORZ_PADD);
+ ViewState[HORZ_PADD] = value;
}
}
public Unit VerticalPadding {
get {
if(IsSet(VERT_PADD))
- return (Unit)(ViewState["VerticalPadding"]);
+ return (Unit)(ViewState[VERT_PADD]);
return Unit.Empty;
}
set {
- ViewState["VerticalPadding"] = value;
- Set(VERT_PADD);
+ ViewState[VERT_PADD] = value;
}
}
{
base.FillStyleAttributes (attributes, urlResolver);
if (IsSet (HORZ_PADD)) {
- attributes.Add (HtmlTextWriterStyle.PaddingLeft, HorizontalPadding.ToString () + "px");
- attributes.Add (HtmlTextWriterStyle.PaddingRight, HorizontalPadding.ToString () + "px");
+ attributes.Add (HtmlTextWriterStyle.PaddingLeft, HorizontalPadding.ToString ());
+ attributes.Add (HtmlTextWriterStyle.PaddingRight, HorizontalPadding.ToString ());
}
if (IsSet (VERT_PADD)) {
- attributes.Add (HtmlTextWriterStyle.PaddingTop, VerticalPadding.ToString () + "px");
- attributes.Add (HtmlTextWriterStyle.PaddingBottom, VerticalPadding.ToString () + "px");
+ attributes.Add (HtmlTextWriterStyle.PaddingTop, VerticalPadding.ToString ());
+ attributes.Add (HtmlTextWriterStyle.PaddingBottom, VerticalPadding.ToString ());
}
}
+
+ [MonoTODO ("Not implemented")]
+ System.ComponentModel.AttributeCollection ICustomTypeDescriptor.GetAttributes ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ string ICustomTypeDescriptor.GetClassName ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ string ICustomTypeDescriptor.GetComponentName ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ TypeConverter ICustomTypeDescriptor.GetConverter ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ EventDescriptor ICustomTypeDescriptor.GetDefaultEvent ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ PropertyDescriptor ICustomTypeDescriptor.GetDefaultProperty ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ object ICustomTypeDescriptor.GetEditor (Type editorBaseType)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ EventDescriptorCollection ICustomTypeDescriptor.GetEvents ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ EventDescriptorCollection ICustomTypeDescriptor.GetEvents (Attribute [] arr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties ()
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ PropertyDescriptorCollection ICustomTypeDescriptor.GetProperties (Attribute [] arr)
+ {
+ throw new NotImplementedException ();
+ }
+
+ [MonoTODO("Not implemented")]
+ object ICustomTypeDescriptor.GetPropertyOwner (PropertyDescriptor pd)
+ {
+ throw new NotImplementedException ();
+ }
}
}