Author: lluis
Date: 2005-05-26 12:16:29 -0400 (Thu, 26 May 2005)
New Revision: 45061
Added:
trunk/mcs/class/System.Web/System.Web.UI/NonVisualControlAttribute.cs
Modified:
trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
trunk/mcs/class/System.Web/System.Web.UI/Control.cs
trunk/mcs/class/System.Web/System.Web.UI/DataSourceView.cs
trunk/mcs/class/System.Web/System.Web.UI/HierarchicalDataSourceControl.cs
trunk/mcs/class/System.Web/System.Web.UI/IDataItemContainer.cs
Log:
2005-05-26 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* DataSourceView.cs: Fix api.
* NonVisualControlAttribute.cs: Implemented.
* IDataItemContainer.cs: Added missing properties.
* Control.cs: Added new EnableTheming and SkinID properties.
* HierarchicalDataSourceControl.cs: Implemented missing methods.
Modified: trunk/mcs/class/System.Web/System.Web.UI/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2005-05-26 16:16:09 UTC
(rev 45060)
+++ trunk/mcs/class/System.Web/System.Web.UI/ChangeLog 2005-05-26 16:16:29 UTC
(rev 45061)
@@ -1,3 +1,11 @@
+2005-05-26 Lluis Sanchez Gual <[EMAIL PROTECTED]>
+
+ * DataSourceView.cs: Fix api.
+ * NonVisualControlAttribute.cs: Implemented.
+ * IDataItemContainer.cs: Added missing properties.
+ * Control.cs: Added new EnableTheming and SkinID properties.
+ * HierarchicalDataSourceControl.cs: Implemented missing methods.
+
2005-05-13 Lluis Sanchez Gual <[EMAIL PROTECTED]>
* ControlCollection.cs: Added internal setter for ReadOnly.
Modified: trunk/mcs/class/System.Web/System.Web.UI/Control.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2005-05-26 16:16:09 UTC
(rev 45060)
+++ trunk/mcs/class/System.Web/System.Web.UI/Control.cs 2005-05-26 16:16:29 UTC
(rev 45061)
@@ -97,6 +97,9 @@
const int VIEWSTATE_LOADED = 1 << 13;
const int LOADED = 1 << 14;
const int PRERENDERED = 1 << 15;
+#if NET_2_0
+ const int ENABLE_THEMING = 1 << 15;
+#endif
/*************/
static Control ()
@@ -810,19 +813,24 @@
}
- public virtual bool HasControls ()
- {
- return (_controls != null && _controls.Count > 0);
- }
+ public virtual bool HasControls ()
+ {
+ return (_controls != null && _controls.Count > 0);
+ }
- public void RenderControl(HtmlTextWriter writer)
- {
- if ((stateMask & VISIBLE) != 0)
- Render(writer);
- }
+#if NET_2_0
+ public virtual
+#else
+ public
+#endif
+ void RenderControl (HtmlTextWriter writer)
+ {
+ if ((stateMask & VISIBLE) != 0)
+ Render(writer);
+ }
- public string ResolveUrl(string relativeUrl)
- {
+ public string ResolveUrl (string relativeUrl)
+ {
if (relativeUrl == null)
throw new ArgumentNullException ("relativeUrl");
@@ -1043,6 +1051,21 @@
}
#if NET_2_0
+
+ string skinId = string.Empty;
+
+ public virtual bool EnableTheming
+ {
+ get { return (stateMask & ENABLE_THEMING) != 0; }
+ set { SetMask (ENABLE_THEMING, value); }
+ }
+
+ public virtual string SkinID
+ {
+ get { return skinId; }
+ set { skinId = value; }
+ }
+
protected string GetWebResourceUrl (string resourceName)
{
return Page.ClientScript.GetWebResourceUrl (GetType(),
resourceName);
Modified: trunk/mcs/class/System.Web/System.Web.UI/DataSourceView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/DataSourceView.cs 2005-05-26
16:16:09 UTC (rev 45060)
+++ trunk/mcs/class/System.Web/System.Web.UI/DataSourceView.cs 2005-05-26
16:16:29 UTC (rev 45061)
@@ -42,12 +42,7 @@
IDataSource dataSourceOwner;
string viewName = String.Empty;
- [MonoTODO ("Extra method to keep things compiling")]
- protected DataSourceView()
- {
- }
-
- protected DataSourceView(IDataSource owner, string viewName)
+ protected DataSourceView (IDataSource owner, string viewName)
{
this.dataSourceOwner = owner;
this.viewName = viewName;
@@ -147,7 +142,7 @@
callBack (selectList);
}
- public virtual int Update(IDictionary keys, IDictionary values,
+ public virtual void Update(IDictionary keys, IDictionary values,
IDictionary oldValues, DataSourceViewOperationCallback
callBack)
{
if (callBack == null)
@@ -163,8 +158,6 @@
if (!callBack (rowAffected, passOn) && passOn != null)
throw passOn;
-
- return rowAffected;
}
public virtual bool CanDelete { get { return false; } }
Modified:
trunk/mcs/class/System.Web/System.Web.UI/HierarchicalDataSourceControl.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/HierarchicalDataSourceControl.cs
2005-05-26 16:16:09 UTC (rev 45060)
+++ trunk/mcs/class/System.Web/System.Web.UI/HierarchicalDataSourceControl.cs
2005-05-26 16:16:29 UTC (rev 45061)
@@ -3,8 +3,10 @@
//
// Authors:
// Ben Maurer ([EMAIL PROTECTED])
+// Lluis Sanchez Gual ([EMAIL PROTECTED])
//
-// (C) 2003 Ben Maurer
+// (C) 2003 Ben Maurer
+// (C) 2005 Novell, Inc (http://www.novell.com)
//
//
@@ -32,9 +34,18 @@
using System.Collections;
using System.Collections.Specialized;
using System.Text;
+using System.ComponentModel;
-namespace System.Web.UI {
- public abstract class HierarchicalDataSourceControl : Control,
IHierarchicalDataSource {
+namespace System.Web.UI
+{
+ [NonVisualControlAttribute]
+ [DesignerAttribute
("System.Web.UI.Design.HierarchicalDataSourceDesigner, System.Design,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a",
"System.ComponentModel.Design.IDesigner")]
+// [ControlBuilderAttribute (typeof(DataSourceControlBuilder))]
+ [BindableAttribute (false)]
+ public abstract class HierarchicalDataSourceControl : Control,
IHierarchicalDataSource
+ {
+ static object dataSourceChanged = new object ();
+
protected HierarchicalDataSourceControl()
{
}
@@ -49,15 +60,42 @@
return this.GetHierarchicalView (viewPath);
}
- //public override bool EnablePersonalization { get; set; }
- //public override bool EnableTheming { get; set; }
- //public override string SkinID { get; set; }
+ public override bool EnableTheming {
+ get { return false; }
+ set { throw new NotSupportedException (); }
+ }
+
+ public override string SkinID {
+ get { return string.Empty; }
+ set { throw new NotSupportedException (); }
+ }
+
public override bool Visible {
get { return false; }
set { throw new NotSupportedException (); }
}
- static object dataSourceChanged = new object ();
+ protected override ControlCollection CreateControlCollection ()
+ {
+ return new EmptyControlCollection (this);
+ }
+
+ public override Control FindControl (string id)
+ {
+ if (id == ID) return this;
+ else return null;
+ }
+
+ public override bool HasControls ()
+ {
+ return false;
+ }
+
+ public override void Focus ()
+ {
+ throw new NotSupportedException ();
+ }
+
event EventHandler
System.Web.UI.IHierarchicalDataSource.DataSourceChanged {
add { Events.AddHandler (dataSourceChanged, value); }
remove { Events.RemoveHandler (dataSourceChanged,
value); }
@@ -69,6 +107,11 @@
if (eh != null)
eh (this, e);
}
+
+ public override void RenderControl (HtmlTextWriter writer)
+ {
+ // nop
+ }
}
Modified: trunk/mcs/class/System.Web/System.Web.UI/IDataItemContainer.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/IDataItemContainer.cs
2005-05-26 16:16:09 UTC (rev 45060)
+++ trunk/mcs/class/System.Web/System.Web.UI/IDataItemContainer.cs
2005-05-26 16:16:29 UTC (rev 45061)
@@ -33,12 +33,11 @@
namespace System.Web.UI
{
- public interface IDataItemContainer
+ public interface IDataItemContainer: INamingContainer
{
object DataItem { get; }
-/* int DataItemIndex { get; }
+ int DataItemIndex { get; }
int DisplayIndex { get; }
-*/
}
}
#endif
Added: trunk/mcs/class/System.Web/System.Web.UI/NonVisualControlAttribute.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI/NonVisualControlAttribute.cs
2005-05-26 16:16:09 UTC (rev 45060)
+++ trunk/mcs/class/System.Web/System.Web.UI/NonVisualControlAttribute.cs
2005-05-26 16:16:29 UTC (rev 45061)
@@ -0,0 +1,76 @@
+//
+// System.Web.UI.WebControls.NonVisualControlAttribute.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 sealed class NonVisualControlAttribute: Attribute
+ {
+ public static readonly NonVisualControlAttribute Visual = new
NonVisualControlAttribute (false);
+ public static readonly NonVisualControlAttribute NonVisual =
new NonVisualControlAttribute (true);
+ public static readonly NonVisualControlAttribute Default =
Visual;
+
+ bool nonVisual;
+
+ public NonVisualControlAttribute (): this (true)
+ {
+ }
+
+ public NonVisualControlAttribute (bool nonVisual)
+ {
+ this.nonVisual = nonVisual;
+ }
+
+ public override bool Equals (object obj)
+ {
+ NonVisualControlAttribute ot = obj as
NonVisualControlAttribute;
+ return ot != null && ot.nonVisual == nonVisual;
+ }
+
+ public override int GetHashCode ()
+ {
+ return GetType().GetHashCode () + nonVisual.GetHashCode
();
+ }
+
+ public override bool IsDefaultAttribute ()
+ {
+ return Equals (Default);
+ }
+
+ public bool IsNonVisual {
+ get { return nonVisual; }
+ }
+ }
+}
+
+#endif
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches