Updates referencesource to .NET 4.7
[mono.git] / mcs / class / referencesource / System.Web.Entity / System / Data / WebControls / EntityDataSourceChangingEventArgs.cs
1 //---------------------------------------------------------------------
2 // <copyright file="EntityDataSourceChangingEventArgs.cs" company="Microsoft">
3 //      Copyright (c) Microsoft Corporation.  All rights reserved.
4 // </copyright>
5 //
6 // @owner       Microsoft
7 // @backupOwner objsdev
8 //---------------------------------------------------------------------
9
10 using System;
11 using System.Collections.Generic;
12 using System.Linq;
13 using System.Text;
14 using System.Data.Objects;
15
16 namespace System.Web.UI.WebControls
17 {
18     public class EntityDataSourceChangingEventArgs : System.ComponentModel.CancelEventArgs
19     {
20         private readonly ObjectContext _context;
21         private readonly Exception _exception = null;
22         private bool _exceptionHandled = false;
23         private readonly object _entity = null;
24
25         internal EntityDataSourceChangingEventArgs(ObjectContext context, object entity)
26         {
27             _context = context;
28             _entity = entity;
29         }
30
31         internal EntityDataSourceChangingEventArgs(Exception exception) 
32         {
33             _exception = exception;
34         }
35
36         public Exception Exception 
37         {
38             get { return _exception; }
39         }
40
41         public bool ExceptionHandled 
42         {
43             get {  return _exceptionHandled; }
44             set { _exceptionHandled = value; }
45         }
46
47         public object Entity 
48         {
49             get {  return _entity; }
50         }
51
52         public ObjectContext Context
53         {
54             get { return _context; }
55         }
56     }
57 }