RegistrationContext
Represents the state of a scoped registration.
using Stashbox.Configuration;
using Stashbox.Lifetime;
using Stashbox.Resolution;
using Stashbox.Utils.Data;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
namespace Stashbox.Registration
{
public class RegistrationContext
{
internal static readonly RegistrationContext Empty = new RegistrationContext();
public object Name { get; set; }
public Delegate Factory { get; set; }
public Type[] FactoryParameters { get; set; }
public ConstructorInfo SelectedConstructor { get; set; }
public object[] ConstructorArguments { get; set; }
public LifetimeDescriptor Lifetime { get; set; }
public Dictionary<object, object> DependencyBindings { get; set; }
public object ExistingInstance { get; set; }
public Action<object> Finalizer { get; set; }
public Delegate Initializer { get; set; }
public Func<object, IDependencyResolver, CancellationToken, Task> AsyncInitializer { get; set; }
public Rules.AutoMemberInjectionRules AutoMemberInjectionRule { get; set; }
public bool AutoMemberInjectionEnabled { get; set; }
public bool IsLifetimeExternallyOwned { get; set; }
public Delegate FuncDelegate { get; set; }
public object DefinedScopeName { get; set; }
public bool IsWireUp { get; set; }
public bool IsFactoryDelegateACompiledLambda { get; set; }
public Func<IEnumerable<ConstructorInfo>, IEnumerable<ConstructorInfo>> ConstructorSelectionRule { get; set; }
public Func<MemberInfo, bool> AutoMemberInjectionFilter { get; set; }
internal ExpandableArray<Type> TargetTypeConditions { get; set; }
internal ExpandableArray<Func<TypeInformation, bool>> ResolutionConditions { get; set; }
internal ExpandableArray<Type> AttributeConditions { get; set; }
internal bool ReplaceExistingRegistration { get; set; }
internal bool ReplaceExistingRegistrationOnlyIfExists { get; set; }
internal ExpandableArray<Type> AdditionalServiceTypes { get; set; }
internal ExpandableArray<KeyValuePair<string, object>> InjectionParameters { get; set; }
internal RegistrationContext()
{
AttributeConditions = new ExpandableArray<Type>();
TargetTypeConditions = new ExpandableArray<Type>();
ResolutionConditions = new ExpandableArray<Func<TypeInformation, bool>>();
AdditionalServiceTypes = new ExpandableArray<Type>();
InjectionParameters = new ExpandableArray<KeyValuePair<string, object>>();
DependencyBindings = new Dictionary<object, object>();
}
}
}