Telerik.Web.Mvc.Infrastructure.ServiceLocator.SetCurrent C# (CSharp) Method

SetCurrent() public static method

public static SetCurrent ( Func factory ) : void
factory Func
return void
        public static void SetCurrent(Func<IServiceLocator> factory)
        {
            Guard.IsNotNull(factory, "factory");

            lock (syncLock)
            {
                if (singleton != null)
                {
                    IDisposable disposable = singleton as IDisposable;

                    if (disposable != null)
                    {
                        disposable.Dispose();
                    }

                    singleton = null;
                }

                singletonFactory = factory;
            }
        }
ServiceLocator