diff options
author | Gaurav Vaish <gvaish@mono-cvs.ximian.com> | 2003-04-09 15:48:05 +0400 |
---|---|---|
committer | Gaurav Vaish <gvaish@mono-cvs.ximian.com> | 2003-04-09 15:48:05 +0400 |
commit | dbd346859acaf3c4e0456b0e5cf653390d21b281 (patch) | |
tree | 2eb45c9680c8adee59abbace72adfb7921ffb291 /mcs/class/System.Web.Mobile | |
parent | ea71384d5716a81a8ea7f178ff85ce50ca963726 (diff) |
2003-04-08 Gaurav Vaish <gvaish_mono AT lycos.com>
* Style.cs : Implements interfaces now.
svn path=/trunk/mcs/; revision=13439
Diffstat (limited to 'mcs/class/System.Web.Mobile')
-rw-r--r-- | mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/ChangeLog | 4 | ||||
-rw-r--r-- | mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/Style.cs | 81 |
2 files changed, 83 insertions, 2 deletions
diff --git a/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/ChangeLog b/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/ChangeLog index 33c47efad9d..91926ad11a3 100644 --- a/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/ChangeLog +++ b/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/ChangeLog @@ -1,4 +1,8 @@ +2003-04-08 Gaurav Vaish <gvaish_mono AT lycos.com> + + * Style.cs : Implements interfaces now. + 2003-04-07 Gaurav Vaish <gvaish_mono AT lycos.com> * MobileListItem.cs : Completed. diff --git a/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/Style.cs b/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/Style.cs index dae2b9888f3..2eddef89e9a 100644 --- a/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/Style.cs +++ b/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/Style.cs @@ -9,12 +9,13 @@ */ using System.Drawing; +using System.Web.UI; using System.Web.Mobile; namespace System.Web.UI.MobileControls { - public class Style //: IParserAttribute, ITemplateable, IStateManager, - // ICloneable + public class Style : IParserAccessor, ITemplateable, IStateManager, + ICloneable { private BooleanOption bold = BooleanOption.NotSet; private BooleanOption italic = BooleanOption.NotSet; @@ -26,12 +27,15 @@ namespace System.Web.UI.MobileControls private Wrapping wrapping = Wrapping.NotSet; private bool marked = false; + private bool checkedStyleRef = false; private MobileControl control = null; private DeviceSpecific deviceSpecific; private FontInfo font; private Style referredStyle; + private StateBag state; + public Style() { } @@ -198,5 +202,78 @@ namespace System.Web.UI.MobileControls this.control = value; } } + + protected internal StateBag State + { + get + { + if(this.state == null) + { + this.state = new StateBag(); + if(((IStateManager)this).IsTrackingViewState) + { + ((IStateManager)state).TrackViewState(); + } + } + return this.state; + } + } + + internal void Refresh() + { + this.referredStyle = null; + this.checkedStyleRef = false; + } + + void IParserAccessor.AddParsedSubObject(object obj) + { + if(obj is DeviceSpecific) + { + DeviceSpecific ds = (DeviceSpecific) obj; + if(this.DeviceSpecific == null) + this.DeviceSpecific = ds; + else + { + throw new ArgumentException("MobileControl" + + "_NoMultipleDeviceSpecifics"); + } + } + } + + void IStateManager.LoadViewState(object state) + { + if(state != null) + { + this.Refresh(); + ((IStateManager)State).LoadViewState(state); + } + } + + object IStateManager.SaveViewState() + { + if(this.state != null) + { + return ((IStateManager)state).SaveViewState(); + } + return null; + } + + bool IStateManager.IsTrackingViewState + { + get + { + return this.marked; + } + } + + void IStateManager.TrackViewState() + { + this.marked = true; + } + + public object Clone() + { + throw new NotImplementedException(); + } } } |