Beispiel #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TypeAccessor"/> class.
        /// </summary>
        /// <param name="type">The <see cref="Type"/> this accessor is for.</param>
        public TypeAccessor(Type type)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type));
            }

            Type         = type;
            _constructor = new Lazy <Func <object> >(() => DelegateFactory.CreateConstructor(Type));
        }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TypeAccessor"/> class.
 /// </summary>
 /// <param name="type">The <see cref="Type"/> this accessor is for.</param>
 public TypeAccessor(Type type)
 {
     _type = type;
     _lateBoundConstructor = new Lazy <LateBoundConstructor>(() => DelegateFactory.CreateConstructor(_type));
 }