示例#1
0
文件: IoC.cs 项目: r2-r/rhino-commons
 /// <summary>
 /// This allows you to override the global container locally
 /// Useful for scenarios where you are replacing the global container
 /// but needs to do some initializing that relies on it.
 /// </summary>
 /// <param name="localContainer"></param>
 /// <returns></returns>
 public static IDisposable UseLocalContainer(IWindsorContainer localContainer)
 {
     LocalContainerStack.Push(localContainer);
     return(new DisposableAction(delegate
     {
         Reset(localContainer);
     }));
 }
示例#2
0
 public static IDisposable UseLocalContainer(IContainer localContainer)
 {
     LocalContainerStack.Push(localContainer);
     return(new DisposableAction(() => Reset(localContainer)));
 }