示例#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);
     }
 }
示例#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);
            }
示例#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);
            }