* ToolTask.cs (ProcessOuputTool): Move logging of tool
[mono.git] / mcs / class / System.Web / System.Web.UI.WebControls / SubMenuStyle.cs
index 7ace5236245b052e7e646976eceb0272b861dcf9..cd99360435e33eb4ae0a06b19b7168a503922bab 100644 (file)
@@ -36,10 +36,10 @@ using System.ComponentModel;
 
 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 ()
                {
@@ -49,17 +49,21 @@ namespace System.Web.UI.WebControls
                {
                }
                
+               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;
                        }
                }
 
@@ -68,12 +72,11 @@ namespace System.Web.UI.WebControls
                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;
                        }
                }
 
@@ -129,14 +132,86 @@ namespace System.Web.UI.WebControls
                {
                        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 ();
+               }
        }
 }