diff options
author | Gaurav Vaish <gvaish@mono-cvs.ximian.com> | 2003-04-04 19:35:44 +0400 |
---|---|---|
committer | Gaurav Vaish <gvaish@mono-cvs.ximian.com> | 2003-04-04 19:35:44 +0400 |
commit | d8d228eb8fa907596b39341ec601429407a3ef37 (patch) | |
tree | 530e52c86a10c6333ed3327d7bd73efcb0a8072a /mcs/class/System.Web.Mobile | |
parent | 43b38fedfcf1f9896f35e9ee580f30b83686a971 (diff) |
2003-04-04 Gaurav Vaish <gvaish_mono AT lycos.com>
* DeviceSpecificChoice.cs: HasTemplates { get; },
: FindAndApplyEvent(...) - Completed
: FindAndApplyProperty(...),
: CheckOnPageEvaluator(...) - Init impl.
svn path=/trunk/mcs/; revision=13140
Diffstat (limited to 'mcs/class/System.Web.Mobile')
-rw-r--r-- | mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/DeviceSpecificChoice.cs | 42 |
2 files changed, 46 insertions, 3 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 c6b641d8853..910cc754cc0 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,11 @@ +2003-04-04 Gaurav Vaish <gvaish_mono AT lycos.com> + + * DeviceSpecificChoice.cs: HasTemplates { get; }, + : FindAndApplyEvent(...) - Completed + : FindAndApplyProperty(...), + : CheckOnPageEvaluator(...) - Init impl. + 2003-04-03 Gaurav Vaish <gvaish_mono AT lycos.com> * DeviceSpecific.cs : Almost done. diff --git a/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/DeviceSpecificChoice.cs b/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/DeviceSpecificChoice.cs index a6e563d3a76..7ac9efbad64 100644 --- a/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/DeviceSpecificChoice.cs +++ b/mcs/class/System.Web.Mobile/System.Web.UI.MobileControls/DeviceSpecificChoice.cs @@ -167,21 +167,57 @@ namespace System.Web.UI.MobileControls } } + /// <summary> + /// Returns false if not found or not applied + /// </summary> private bool FindAndApplyProperty(object parentObj, string key, string value) { - throw new NotImplementedException(); + bool retVal = false; + PropertyDescriptor pd = + TypeDescriptor.GetProperties(parentObj).Find(key, true); + if(pd != null) + { + if(pd.Attributes.Contains( + DesignerSerializationVisibilityAttribute.Hidden)) + { + throw new ArgumentException("DeviceSpecificChoice" + + "_OverridingPropertyNotDeclarable"); + } + throw new NotImplementedException(); + } } private bool FindAndApplyEvent(object parentObj, string key, string value) { - throw new NotImplementedException(); + bool retVal = false; + if(key.Length > 0) + { + if(key.ToLower().StartsWith("on")) + { + string eventName = key.Substring(2); + EventDescriptor ed = + TypeDescriptor.GetEvents(parentObj).Find(key, true); + if(ed != null) + { + ed.AddEventHandler(parentObj, + Delegate.CreateDelegate(ed.EventType, + Owner.MobilePage, eventName)); + } + } + } + return retVal; } private bool CheckOnPageEvaluator(MobileCapabilities capabilities, out bool evaluatorResult) { + boolr retVal = false; + evaluatorResult = false; + TemplateControl tc = Owner.ClosestTemplateControl; + // I have to get the method (MethodInfo?) and then invoke + // the method and send back the results of the method! throw new NotImplementedException(); } @@ -189,7 +225,7 @@ namespace System.Web.UI.MobileControls { get { - throw new NotImplementedException(); + return (templates != null && templates.Count > 0); } } } |