public Deserializer(ILogger logger, IReflectionCache reflectionCache, IConversionFactory conversionFactory)
 {
     _logger            = logger;
     _packetReader      = new PacketReader();
     _reflectionCache   = reflectionCache;
     _conversionFactory = conversionFactory;
 }
Example #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Adic.InjectorBinder"/> class.
        /// </summary>
        /// <param name="cache">Reflection cache used to get type info.</param>
        /// <param name="binder">Binder used to resolved bindings.</param>
        public Injector(IReflectionCache cache, IBinder binder)
        {
            this.cache  = cache;
            this.binder = binder;

            this.binder.beforeAddBinding += this.OnBeforeAddBinding;
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Adic.InjectorBinder"/> class.
        /// </summary>
        /// <param name="cache">Reflection cache used to get type info.</param>
        /// <param name="binder">Binder used to resolved bindings.</param>
        public Injector(IReflectionCache cache, IBinder binder, ResolutionMode resolutionMode)
        {
            this.cache          = cache;
            this.binder         = binder;
            this.resolutionMode = resolutionMode;

            this.binder.beforeAddBinding += this.OnBeforeAddBinding;
        }
 public InjectionContainer(
     object id,
     IReflectionCache cache,
     IBinder binder,
     ResolutionMode resolutionMode)
     : base(cache, binder, resolutionMode)
 {
     this.id = id;
     RegisterSelf();
 }
Example #5
0
        public ReflectionTypeInfo(Type type, IReflectionCache cache = null)
        {
            if (type is null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            this.type    = type;
            this.cache   = cache;
            this.factory = cache?.ReflectionFactory ??
                           NerdyMishka.Reflection.ReflectionFactory.Default;
        }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <remarks>
 /// Default binder and injector objects are created.
 /// </remarks>
 /// <param name="cache">Reflection cache used to get type info.</param>
 /// <param name="resolutionMode">Instance resolution mode.</param>
 public InjectionContainer(IReflectionCache cache, ResolutionMode resolutionMode)
     : this(GenerateIdentifier(), cache, new Binder(), resolutionMode)
 {
 }
Example #7
0
 public ReflectionFactory(ReflectionCache cache = null)
 {
     this.cache = cache;
 }
Example #8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <remarks>
 /// Default binder and injector objects are created.
 /// </remarks>
 /// <param name="identifier">Container identifier.</param>
 /// <param name="cache">Reflection cache used to get type info.</param>
 public InjectionContainer(object identifier, IReflectionCache cache) : base(cache, new Binder())
 {
     this.identifier = identifier;
     this.RegisterItself();
 }
Example #9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <remarks>
 /// Default binder and injector objects are created.
 /// </remarks>
 /// <param name="cache">Reflection cache used to get type info.</param>
 public InjectionContainer(IReflectionCache cache)
     : this(GenerateIdentifier(), cache, new Binder(), DEFAULT_RESOLUTION_MODE)
 {
 }
 public InjectionContainer(object id, IReflectionCache cache, IBinder binder)
     : base(cache, binder, DEFAULT_RESOLUTION_MODE)
 {
     this.id = id;
     RegisterSelf();
 }
 public InjectionContainer(IReflectionCache cache, IBinder binder)
     : base(cache, binder, DEFAULT_RESOLUTION_MODE)
 {
     RegisterSelf();
 }
 public InjectionContainer(IReflectionCache cache, ResolutionMode resolutionMode)
     : base(cache, new Binder(), resolutionMode)
 {
     RegisterSelf();
 }
Example #13
0
 public ReflectionTypeInfo(Type type, IReflectionCache cache)
 {
     this.clrType = type ?? throw new ArgumentNullException(nameof(type));
     this.cache   = cache ?? throw new ArgumentNullException(nameof(cache));
     this.factory = cache.Factory ?? ReflectionFactory.Default;
 }
Example #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <remarks>
 /// Default binder and injector objects are created.
 /// </remarks>
 /// <param name="identifier">Container identifier.</param>
 /// <param name="cache">Reflection cache used to get type info.</param>
 public InjectionContainer(object identifier, IReflectionCache cache)
     : base(cache, new Binder(), DEFAULT_RESOLUTION_MODE)
 {
     this.identifier = identifier;
     this.RegisterItself();
 }
Example #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <param name="cache">Reflection cache used to get type info.</param>
 /// <param name="binder">Binder to be used on the container.</param>
 public InjectionContainer(IReflectionCache cache, IBinder binder) : base(cache, binder)
 {
     this.RegisterItself();
 }
Example #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <param name="identifier">Container identifier.</param>
 /// <param name="cache">Reflection cache used to get type info.</param>
 /// <param name="resolutionMode">Instance resolution mode.</param>
 public InjectionContainer(object identifier, IReflectionCache cache, ResolutionMode resolutionMode)
     : this(identifier, cache, new Binder(), resolutionMode)
 {
 }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <param name="identifier">Container identifier.</param>
 /// <param name="cache">Reflection cache used to get type info.</param>
 /// <param name="binder">Binder to be used on the container.</param>
 /// <param name="resolutionMode">Instance resolution mode.</param>
 public InjectionContainer(object identifier, IReflectionCache cache, IBinder binder,
                           ResolutionMode resolutionMode) : base(cache, binder, resolutionMode)
 {
     this.identifier = identifier;
     this.RegisterItself();
 }
Example #18
0
 public PacketConverter(IReflectionCache reflectionCache) => _reflectionCache = reflectionCache;
Example #19
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <remarks>
 /// Default binder and injector objects are created.
 /// </remarks>
 /// <param name="identifier">Container identifier.</param>
 /// <param name="cache">Reflection cache used to get type info.</param>
 public InjectionContainer(object identifier, IReflectionCache cache)
     : this(identifier, cache, new Binder(), DEFAULT_RESOLUTION_MODE)
 {
 }
Example #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Adic.InjectionContainer"/> class.
 /// </summary>
 /// <remarks>
 /// <remarks>
 /// Default binder and injector objects are created.
 /// </remarks>
 /// <param name="cache">Reflection cache used to get type info.</param>
 public InjectionContainer(IReflectionCache cache) : base(cache, new Binder())
 {
     this.RegisterItself();
 }