forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRefreshEvent.cs
43 lines (37 loc) · 974 Bytes
/
RefreshEvent.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System;
using System.Collections.Generic;
using System.Text;
namespace NHibernate.Event
{
/// <summary>
/// Defines an event class for the refreshing of an object.
/// </summary>
[Serializable]
public class RefreshEvent : AbstractEvent
{
private readonly LockMode lockMode= LockMode.Read;
private readonly object entity;
public RefreshEvent(object entity, IEventSource source)
: base(source)
{
if (entity == null)
throw new ArgumentNullException("entity", "Attempt to generate refresh event with null object");
this.entity = entity;
}
public RefreshEvent(object entity, LockMode lockMode, IEventSource source)
: this(entity, source)
{
if (lockMode == null)
throw new ArgumentNullException("lockMode", "Attempt to generate refresh event with null lock mode");
this.lockMode = lockMode;
}
public object Entity
{
get { return entity; }
}
public LockMode LockMode
{
get { return lockMode; }
}
}
}