コード例 #1
0
		public void Complete(InterceptArgs e)
		{
			var scopes = ApplicationContext.LocalContext[ObjectInterceptor.ScopesKey] as Stack<ILifetimeScope>;
			var scope = scopes.Pop();
			scope.Dispose();

			if (scopes.Count == 0)
			{
				ApplicationContext.LocalContext.Remove(ObjectInterceptor.ScopesKey);
			}
		}
コード例 #2
0
		public void Initialize(InterceptArgs e)
		{
			Stack<ILifetimeScope> scopes = null;

			if (!ApplicationContext.LocalContext.Contains(ObjectInterceptor.ScopesKey))
			{
				scopes = new Stack<ILifetimeScope>();
				ApplicationContext.LocalContext.Add(ObjectInterceptor.ScopesKey, scopes);
			}
			else
			{
				scopes = ApplicationContext.LocalContext[ObjectInterceptor.ScopesKey] as Stack<ILifetimeScope>;
			}

			var scope = IoC.Container.BeginLifetimeScope();
			scopes.Push(scope);
		}
コード例 #3
0
ファイル: DataPortal.cs プロジェクト: BiYiTuan/csla
 internal void Initialize(InterceptArgs e)
 {
   if (_interceptor != null)
     _interceptor.Initialize(e);
 }
コード例 #4
0
ファイル: DataPortal.cs プロジェクト: BiYiTuan/csla
 internal void Complete(InterceptArgs e)
 {
   if (_interceptor != null)
     _interceptor.Complete(e);
 }