@ -669,13 +669,7 @@ namespace TinyIoC
private static readonly NamedParameterOverloads _Default = new NamedParameterOverloads ( ) ;
private static readonly NamedParameterOverloads _Default = new NamedParameterOverloads ( ) ;
public static NamedParameterOverloads Default
public static NamedParameterOverloads Default = > _Default ;
{
get
{
return _Default ;
}
}
}
}
public enum UnregisteredResolutionActions
public enum UnregisteredResolutionActions
@ -741,46 +735,22 @@ namespace TinyIoC
/// <summary>
/// <summary>
/// Gets the default options (attempt resolution of unregistered types, fail on named resolution if name not found)
/// Gets the default options (attempt resolution of unregistered types, fail on named resolution if name not found)
/// </summary>
/// </summary>
public static ResolveOptions Default
public static ResolveOptions Default = > _Default ;
{
get
{
return _Default ;
}
}
/// <summary>
/// <summary>
/// Preconfigured option for attempting resolution of unregistered types and failing on named resolution if name not found
/// Preconfigured option for attempting resolution of unregistered types and failing on named resolution if name not found
/// </summary>
/// </summary>
public static ResolveOptions FailNameNotFoundOnly
public static ResolveOptions FailNameNotFoundOnly = > _FailNameNotFoundOnly ;
{
get
{
return _FailNameNotFoundOnly ;
}
}
/// <summary>
/// <summary>
/// Preconfigured option for failing on resolving unregistered types and on named resolution if name not found
/// Preconfigured option for failing on resolving unregistered types and on named resolution if name not found
/// </summary>
/// </summary>
public static ResolveOptions FailUnregisteredAndNameNotFound
public static ResolveOptions FailUnregisteredAndNameNotFound = > _FailUnregisteredAndNameNotFound ;
{
get
{
return _FailUnregisteredAndNameNotFound ;
}
}
/// <summary>
/// <summary>
/// Preconfigured option for failing on resolving unregistered types, but attempting unnamed resolution if name not found
/// Preconfigured option for failing on resolving unregistered types, but attempting unnamed resolution if name not found
/// </summary>
/// </summary>
public static ResolveOptions FailUnregisteredOnly
public static ResolveOptions FailUnregisteredOnly = > _FailUnregisteredOnly ;
{
get
{
return _FailUnregisteredOnly ;
}
}
}
}
# endregion
# endregion
@ -2394,7 +2364,7 @@ namespace TinyIoC
/// Generally set to true for delegate style factories as CanResolve cannot delve
/// Generally set to true for delegate style factories as CanResolve cannot delve
/// into the delegates they contain.
/// into the delegates they contain.
/// </summary>
/// </summary>
public virtual bool AssumeConstruction { get { return false ; } }
public virtual bool AssumeConstruction => false ;
/// <summary>
/// <summary>
/// The type the factory instantiates
/// The type the factory instantiates
@ -2471,7 +2441,7 @@ namespace TinyIoC
{
{
private readonly Type registerType ;
private readonly Type registerType ;
private readonly Type registerImplementation ;
private readonly Type registerImplementation ;
public override Type CreatesType { get { return this . registerImplementation ; } }
public override Type CreatesType => this . registerImplementation ;
public MultiInstanceFactory ( Type registerType , Type registerImplementation )
public MultiInstanceFactory ( Type registerType , Type registerImplementation )
{
{
@ -2501,26 +2471,14 @@ namespace TinyIoC
}
}
}
}
public override ObjectFactoryBase SingletonVariant
public override ObjectFactoryBase SingletonVariant = > new SingletonFactory ( this . registerType , this . registerImplementation ) ;
{
get
{
return new SingletonFactory ( this . registerType , this . registerImplementation ) ;
}
}
public override ObjectFactoryBase GetCustomObjectLifetimeVariant ( ITinyIoCObjectLifetimeProvider lifetimeProvider , string errorString )
public override ObjectFactoryBase GetCustomObjectLifetimeVariant ( ITinyIoCObjectLifetimeProvider lifetimeProvider , string errorString )
{
{
return new CustomObjectLifetimeFactory ( this . registerType , this . registerImplementation , lifetimeProvider , errorString ) ;
return new CustomObjectLifetimeFactory ( this . registerType , this . registerImplementation , lifetimeProvider , errorString ) ;
}
}
public override ObjectFactoryBase MultiInstanceVariant
public override ObjectFactoryBase MultiInstanceVariant = > this ;
{
get
{
return this ;
}
}
}
}
/// <summary>
/// <summary>
@ -2532,9 +2490,9 @@ namespace TinyIoC
private Func < TinyIoCContainer , NamedParameterOverloads , object > _factory ;
private Func < TinyIoCContainer , NamedParameterOverloads , object > _factory ;
public override bool AssumeConstruction { get { return true ; } }
public override bool AssumeConstruction => true ;
public override Type CreatesType { get { return this . registerType ; } }
public override Type CreatesType => this . registerType ;
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
{
{
@ -2558,21 +2516,9 @@ namespace TinyIoC
this . registerType = registerType ;
this . registerType = registerType ;
}
}
public override ObjectFactoryBase WeakReferenceVariant
public override ObjectFactoryBase WeakReferenceVariant = > new WeakDelegateFactory ( this . registerType , _factory ) ;
{
get
{
return new WeakDelegateFactory ( this . registerType , _factory ) ;
}
}
public override ObjectFactoryBase StrongReferenceVariant
public override ObjectFactoryBase StrongReferenceVariant = > this ;
{
get
{
return this ;
}
}
public override void SetConstructor ( ConstructorInfo constructor )
public override void SetConstructor ( ConstructorInfo constructor )
{
{
@ -2590,9 +2536,9 @@ namespace TinyIoC
private WeakReference _factory ;
private WeakReference _factory ;
public override bool AssumeConstruction { get { return true ; } }
public override bool AssumeConstruction => true ;
public override Type CreatesType { get { return this . registerType ; } }
public override Type CreatesType => this . registerType ;
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
{
{
@ -2634,13 +2580,7 @@ namespace TinyIoC
}
}
}
}
public override ObjectFactoryBase WeakReferenceVariant
public override ObjectFactoryBase WeakReferenceVariant = > this ;
{
get
{
return this ;
}
}
public override void SetConstructor ( ConstructorInfo constructor )
public override void SetConstructor ( ConstructorInfo constructor )
{
{
@ -2657,7 +2597,7 @@ namespace TinyIoC
private readonly Type registerImplementation ;
private readonly Type registerImplementation ;
private object _instance ;
private object _instance ;
public override bool AssumeConstruction { get { return true ; } }
public override bool AssumeConstruction => true ;
public InstanceFactory ( Type registerType , Type registerImplementation , object instance )
public InstanceFactory ( Type registerType , Type registerImplementation , object instance )
{
{
@ -2669,36 +2609,18 @@ namespace TinyIoC
_instance = instance ;
_instance = instance ;
}
}
public override Type CreatesType
public override Type CreatesType = > this . registerImplementation ;
{
get { return this . registerImplementation ; }
}
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
{
{
return _instance ;
return _instance ;
}
}
public override ObjectFactoryBase MultiInstanceVariant
public override ObjectFactoryBase MultiInstanceVariant = > new MultiInstanceFactory ( this . registerType , this . registerImplementation ) ;
{
get { return new MultiInstanceFactory ( this . registerType , this . registerImplementation ) ; }
}
public override ObjectFactoryBase WeakReferenceVariant
public override ObjectFactoryBase WeakReferenceVariant = > new WeakInstanceFactory ( this . registerType , this . registerImplementation , this . _instance ) ;
{
get
{
return new WeakInstanceFactory ( this . registerType , this . registerImplementation , this . _instance ) ;
}
}
public override ObjectFactoryBase StrongReferenceVariant
public override ObjectFactoryBase StrongReferenceVariant = > this ;
{
get
{
return this ;
}
}
public override void SetConstructor ( ConstructorInfo constructor )
public override void SetConstructor ( ConstructorInfo constructor )
{
{
@ -2735,10 +2657,7 @@ namespace TinyIoC
_instance = new WeakReference ( instance ) ;
_instance = new WeakReference ( instance ) ;
}
}
public override Type CreatesType
public override Type CreatesType = > this . registerImplementation ;
{
get { return this . registerImplementation ; }
}
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
{
{
@ -2750,21 +2669,9 @@ namespace TinyIoC
return instance ;
return instance ;
}
}
public override ObjectFactoryBase MultiInstanceVariant
public override ObjectFactoryBase MultiInstanceVariant = > new MultiInstanceFactory ( this . registerType , this . registerImplementation ) ;
{
get
{
return new MultiInstanceFactory ( this . registerType , this . registerImplementation ) ;
}
}
public override ObjectFactoryBase WeakReferenceVariant
public override ObjectFactoryBase WeakReferenceVariant = > this ;
{
get
{
return this ;
}
}
public override ObjectFactoryBase StrongReferenceVariant
public override ObjectFactoryBase StrongReferenceVariant
{
{
@ -2819,10 +2726,7 @@ namespace TinyIoC
this . registerImplementation = registerImplementation ;
this . registerImplementation = registerImplementation ;
}
}
public override Type CreatesType
public override Type CreatesType = > this . registerImplementation ;
{
get { return this . registerImplementation ; }
}
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
{
{
@ -2836,26 +2740,14 @@ namespace TinyIoC
return _Current ;
return _Current ;
}
}
public override ObjectFactoryBase SingletonVariant
public override ObjectFactoryBase SingletonVariant = > this ;
{
get
{
return this ;
}
}
public override ObjectFactoryBase GetCustomObjectLifetimeVariant ( ITinyIoCObjectLifetimeProvider lifetimeProvider , string errorString )
public override ObjectFactoryBase GetCustomObjectLifetimeVariant ( ITinyIoCObjectLifetimeProvider lifetimeProvider , string errorString )
{
{
return new CustomObjectLifetimeFactory ( this . registerType , this . registerImplementation , lifetimeProvider , errorString ) ;
return new CustomObjectLifetimeFactory ( this . registerType , this . registerImplementation , lifetimeProvider , errorString ) ;
}
}
public override ObjectFactoryBase MultiInstanceVariant
public override ObjectFactoryBase MultiInstanceVariant = > new MultiInstanceFactory ( this . registerType , this . registerImplementation ) ;
{
get
{
return new MultiInstanceFactory ( this . registerType , this . registerImplementation ) ;
}
}
public override ObjectFactoryBase GetFactoryForChildContainer ( Type type , TinyIoCContainer parent , TinyIoCContainer child )
public override ObjectFactoryBase GetFactoryForChildContainer ( Type type , TinyIoCContainer parent , TinyIoCContainer child )
{
{
@ -2908,10 +2800,7 @@ namespace TinyIoC
_LifetimeProvider = lifetimeProvider ;
_LifetimeProvider = lifetimeProvider ;
}
}
public override Type CreatesType
public override Type CreatesType = > this . registerImplementation ;
{
get { return this . registerImplementation ; }
}
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
public override object GetObject ( Type requestedType , TinyIoCContainer container , NamedParameterOverloads parameters , ResolveOptions options )
{
{
@ -2980,13 +2869,8 @@ namespace TinyIoC
/// <summary>
/// <summary>
/// Lazy created Singleton instance of the container for simple scenarios
/// Lazy created Singleton instance of the container for simple scenarios
/// </summary>
/// </summary>
public static TinyIoCContainer Current
public static TinyIoCContainer Current = > _Current ;
{
get
{
return _Current ;
}
}
# endregion
# endregion
#region Type Registrations
#region Type Registrations