Example #1
0
        public virtual object Resolve(FastContainer container)
        {
            AssertNotDisposed();
            if (FastContainer.SupperLogging && Logger.IsDebugEnabled)
            {
                Logger.DebugFormat("Resolving Instance");
            }
            if (this.instancePerCall)
            {
                if (FastContainer.SupperLogging && Logger.IsDebugEnabled)
                {
                    Logger.DebugFormat("Building New Instance");
                }
                return(this.resolve(container));
            }

            if (FastContainer.SupperLogging && Logger.IsDebugEnabled)
            {
                Logger.DebugFormat("Attempting To Resolve Instance");
            }

            if (this.instance != null)
            {
                return(this.instance);
            }

            if (FastContainer.SupperLogging && Logger.IsDebugEnabled)
            {
                Logger.DebugFormat("Building And Storing New Instance");
            }
            return(this.instance = this.resolve(container));
        }
Example #2
0
 private FastContainer(FastContainer other)
 {
     this.registrations = new Dictionary <Type, FastContainerRegistration>();
     foreach (var otherRegistration in other.registrations)
     {
         this.registrations.Add(otherRegistration.Key, otherRegistration.Value.Clone());
     }
 }
Example #3
0
 public FastServiceLocatorImpl(FastContainer container)
 {
     this.container = container;
 }