projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of github.com:mono/mono
[mono.git]
/
mcs
/
class
/
System.Web
/
System.Web.UI
/
DataSourceView.cs
diff --git
a/mcs/class/System.Web/System.Web.UI/DataSourceView.cs
b/mcs/class/System.Web/System.Web.UI/DataSourceView.cs
index ddcca295f05db9904f2e514285f5728b787e73f6..7415b671ec96a16e45f27931d151c0727dd42e29 100644
(file)
--- a/
mcs/class/System.Web/System.Web.UI/DataSourceView.cs
+++ b/
mcs/class/System.Web/System.Web.UI/DataSourceView.cs
@@
-6,7
+6,7
@@
// Sanjay Gupta (gsanjay@novell.com)
//
// (C) 2003 Ben Maurer
// Sanjay Gupta (gsanjay@novell.com)
//
// (C) 2003 Ben Maurer
-// (C) 2004 Novell, Inc. (http://www.novell.com)
+// (C) 2004
-2010
Novell, Inc. (http://www.novell.com)
//
//
//
//
@@
-30,7
+30,6
@@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
using System.Collections;
using System.Collections.Specialized;
using System.Text;
using System.Collections;
using System.Collections.Specialized;
using System.Text;
@@
-39,13
+38,21
@@
using System.ComponentModel;
namespace System.Web.UI {
public abstract class DataSourceView
{
namespace System.Web.UI {
public abstract class DataSourceView
{
- IDataSource dataSourceOwner;
+
//
IDataSource dataSourceOwner;
string viewName = String.Empty;
protected DataSourceView (IDataSource owner, string viewName)
{
string viewName = String.Empty;
protected DataSourceView (IDataSource owner, string viewName)
{
- this.dataSourceOwner = owner;
+ if (owner == null)
+ throw new ArgumentNullException ("owner");
+
+ //this.dataSourceOwner = owner;
this.viewName = viewName;
this.viewName = viewName;
+ owner.DataSourceChanged += new EventHandler (OnDataSourceChanged);
+ }
+
+ void OnDataSourceChanged (object sender, EventArgs e) {
+ OnDataSourceViewChanged (EventArgs.Empty);
}
public virtual void Delete (IDictionary keys, IDictionary values,
}
public virtual void Delete (IDictionary keys, IDictionary values,
@@
-54,16
+61,16
@@
namespace System.Web.UI {
if (callBack == null)
throw new ArgumentNullException ("callBack");
if (callBack == null)
throw new ArgumentNullException ("callBack");
- int rowAffected = 0;
- Exception passOn = null;
+ int rowAffected;
try {
rowAffected = ExecuteDelete (keys, values);
try {
rowAffected = ExecuteDelete (keys, values);
- } catch (Exception e) {
- passOn = e;
}
}
-
- if (!callBack (rowAffected, passOn) && passOn != null)
- throw passOn;
+ catch (Exception e) {
+ if (!callBack (0, e))
+ throw;
+ return;
+ }
+ callBack (rowAffected, null);
}
protected virtual int ExecuteDelete(IDictionary keys, IDictionary values)
}
protected virtual int ExecuteDelete(IDictionary keys, IDictionary values)
@@
-91,16
+98,16
@@
namespace System.Web.UI {
if (callBack == null)
throw new ArgumentNullException("callBack");
if (callBack == null)
throw new ArgumentNullException("callBack");
- int rowAffected = 0;
- Exception passOn = null;
+ int rowAffected;
try {
rowAffected = ExecuteInsert (values);
} catch (Exception e) {
try {
rowAffected = ExecuteInsert (values);
} catch (Exception e) {
- passOn = e;
+ if (!callBack (0, e))
+ throw;
+ return;
}
}
- if (!callBack (rowAffected, passOn) && passOn != null)
- throw passOn;
+ callBack (rowAffected, null);
}
protected virtual void OnDataSourceViewChanged (EventArgs eventArgs)
}
protected virtual void OnDataSourceViewChanged (EventArgs eventArgs)
@@
-148,16
+155,16
@@
namespace System.Web.UI {
if (callBack == null)
throw new ArgumentNullException ("callBack");
if (callBack == null)
throw new ArgumentNullException ("callBack");
- int rowAffected = 0;
- Exception passOn = null;
+ int rowAffected;
try {
rowAffected = ExecuteUpdate (keys, values, oldValues);
} catch (Exception e) {
try {
rowAffected = ExecuteUpdate (keys, values, oldValues);
} catch (Exception e) {
- passOn = e;
+ if (!callBack (0, e))
+ throw;
+ return;
}
}
- if (!callBack (rowAffected, passOn) && passOn != null)
- throw passOn;
+ callBack (rowAffected, null);
}
public virtual bool CanDelete { get { return false; } }
}
public virtual bool CanDelete { get { return false; } }
@@
-182,7
+189,7
@@
namespace System.Web.UI {
return eventsList != null;
}
return eventsList != null;
}
- public
virtual
string Name {
+ public string Name {
get { return viewName; }
}
get { return viewName; }
}
@@
-197,5
+204,4
@@
namespace System.Web.UI {
}
}
}
}
-#endif