Author: lluis
Date: 2005-04-21 12:14:16 -0400 (Thu, 21 Apr 2005)
New Revision: 43409
Added:
trunk/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs
Modified:
trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI/DataBinder.cs
trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
Log:
2005-04-21 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* IEditableTextControl.cs: Implemented.
* DataBinder.cs: Marked constructor as obsolete in 2.0.
In GetDataItem, check for the IDataItemContainer interface
in the container.
* TemplateControl.cs: Improved check for data item.
Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2005-04-21 15:36:56 UTC
(rev 43408)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2005-04-21 16:14:16 UTC
(rev 43409)
@@ -1,3 +1,11 @@
+2005-04-21 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * IEditableTextControl.cs: Implemented.
+ * DataBinder.cs: Marked constructor as obsolete in 2.0.
+ In GetDataItem, check for the IDataItemContainer interface
+ in the container.
+ * TemplateControl.cs: Improved check for data item.
+
2005-04-21 Gonzalo Paniagua Javier <[EMAIL PROTECTED]>
* TemplateParser.cs: we still need LoadWithPartialName if Load fails.
Modified: trunk/mcs/class/System.Web/System.Web.UI/DataBinder.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/DataBinder.cs 2005-04-21
15:36:56 UTC (rev 43408)
+++ trunk/mcs/class/System.Web/System.Web.UI/DataBinder.cs 2005-04-21
16:14:16 UTC (rev 43409)
@@ -38,6 +38,9 @@
public sealed class DataBinder
{
+#if NET_2_0
+ [Obsolete]
+#endif
public DataBinder ()
{
}
@@ -193,6 +196,11 @@
if (container == null)
return null;
+ if (container is IDataItemContainer) {
+ foundDataItem = true;
+ return ((IDataItemContainer)container).DataItem;
+ }
+
PropertyInfo pi = container.GetType ().GetProperty
("DataItem", BindingFlags.Public | BindingFlags.Instance);
if (pi == null)
return null;
Added: trunk/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs
2005-04-21 15:36:56 UTC (rev 43408)
+++ trunk/mcs/class/System.Web/System.Web.UI/IEditableTextControl.cs
2005-04-21 16:14:16 UTC (rev 43409)
@@ -0,0 +1,42 @@
+//
+// System.Web.UI.IEditableTextControl.cs
+//
+// Authors:
+// Lluis Sanchez Gual ([EMAIL PROTECTED])
+//
+// (C) 2005 Novell, Inc (http://www.novell.com)
+//
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+
+#if NET_2_0
+using System;
+
+namespace System.Web.UI
+{
+ public interface IEditableTextControl: ITextControl
+ {
+ event EventHandler TextChanged;
+ }
+}
+#endif
+
Modified: trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.cs 2005-04-21
15:36:56 UTC (rev 43408)
+++ trunk/mcs/class/System.Web/System.Web.UI/TemplateControl.cs 2005-04-21
16:14:16 UTC (rev 43409)
@@ -282,7 +282,7 @@
internal object CurrentDataItem {
get {
- if (dataItemCtx == null)
+ if (dataItemCtx == null || dataItemCtx.Count == 0)
throw new InvalidOperationException ("No data
item");
return dataItemCtx.Peek ();
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches