コード例 #1
0
 public virtual void OnCommitted(object sender, ContextEventArgs e)
 {
 }
コード例 #2
0
		public void OnCommitted(object sender, ContextEventArgs e)
		{
			IUnitOfWork unitOfWork;
			if (this.ValidationManager.ValidateOnCommitted)
			{
				unitOfWork = this.Context.UnitOfWork;
				foreach (object obj in unitOfWork.GetCreatedObjects())
				{
					if (obj is IValidatable)
					{
						((IValidatable) (obj)).Validate();
					}
				}
				foreach (object obj in unitOfWork.GetDirtyObjects())
				{
					if (obj is IValidatable)
					{
						((IValidatable) (obj)).Validate();
					}
				}
				foreach (object obj in unitOfWork.GetDeletedObjects())
				{
					if (obj is IValidatable)
					{
						((IValidatable) (obj)).Validate();
					}
				}
			}
			if (!(m_RaiseEvents))
			{
				return;
			}
			if (!(m_RaiseAfterEvents))
			{
				return;
			}
			if (!(m_RaiseContextEvents))
			{
				return;
			}
			foreach (IObserver observer in m_Observers)
			{
				observer.OnCommitted(sender, e);
			}
			foreach (IObserver observer in m_ContextObservers)
			{
				observer.OnCommitted(sender, e);
			}
			this.Observer.OnCommitted(sender, e);
		}