Browse Source

* DataSourceView.cs: Moved here implementation of
* DataSourceViewChanged
from SqlDataSourceView.cs.


svn path=/trunk/mcs/; revision=36150

Lluis Sanchez 21 years ago
parent
commit
53e5fd0ef5

+ 5 - 0
mcs/class/System.Web/System.Web.UI/ChangeLog

@@ -1,3 +1,8 @@
+2004-11-15 Lluis Sanchez Gual <[email protected]>
+
+	* DataSourceView.cs: Moved here implementation of DataSourceViewChanged 
+	from SqlDataSourceView.cs.
+
 2004-11-09 Gonzalo Paniagua Javier <[email protected]>
 
 	* Control.cs: unified a few bool fields into an int one.

+ 14 - 10
mcs/class/System.Web/System.Web.UI/DataSourceView.cs

@@ -106,14 +106,11 @@ namespace System.Web.UI {
 			callBack (rowAffected, passOn);
 		}
 
-		[MonoTODO]
 		protected virtual void OnDataSourceViewChanged (EventArgs eventArgs)
 		{
-			if (eventsList == null)
-				return;
-			/*EventHandler evtHandler = eventsList [EventDataSourceViewChanged] as EventHandler;
+			EventHandler evtHandler = eventsList [EventDataSourceViewChanged] as EventHandler;
 			if (evtHandler != null)
-				evtHandler(this, eventArgs);*/
+				evtHandler(this, eventArgs);
 		}
 		
 		protected internal virtual void RaiseUnsupportedCapabilityError (
@@ -204,16 +201,23 @@ namespace System.Web.UI {
 				return eventsList;
 			}
 		}
+		
+		internal bool HasEvents ()
+		{
+			return eventsList != null;
+		}
 
 		public virtual string Name { 
 			get { return viewName; } 
 		}
 
-		public event EventHandler DataSourceViewChanged;	
-		/*{
-			//add { Events.AddHandler (EventDataSourceViewChanged, value); }
-			//remove { Events.RemoveHandler (EventDataSourceViewChanged, value); }
-		}*/
+		static readonly object EventDataSourceViewChanged = new object ();
+				
+		public event EventHandler DataSourceViewChanged
+		{
+			add { Events.AddHandler (EventDataSourceViewChanged, value); }
+			remove { Events.RemoveHandler (EventDataSourceViewChanged, value); }
+		}
 		
 	}