Ejemplo n.º 1
0
 public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
 {
     try
     {
         return(container.ConstructType(requestedType, registerImplementation, Constructor, parameters, options));
     }
     catch (TinyIoCResolutionException ex)
     {
         throw new TinyIoCResolutionException(registerType, ex);
     }
 }
Ejemplo n.º 2
0
            public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
            {
                if (parameters.Count != 0)
                {
                    throw new ArgumentException("Cannot specify parameters for singleton types");
                }

                lock (SingletonLock)
                    if (_Current == null)
                    {
                        _Current = container.ConstructType(requestedType, registerImplementation, Constructor, options);
                    }

                return(_Current);
            }
Ejemplo n.º 3
0
            public override object GetObject(Type requestedType, TinyIoCContainer container, NamedParameterOverloads parameters, ResolveOptions options)
            {
                object current;

                lock (SingletonLock)
                {
                    current = _LifetimeProvider.GetObject();
                    if (current == null)
                    {
                        current = container.ConstructType(requestedType, registerImplementation, Constructor, options);
                        _LifetimeProvider.SetObject(current);
                    }
                }

                return(current);
            }