Пример #1
0
        public override object Instantiate(Type type)
        {
            Func <object> constructor;

            if (!constructorCache.TryGetValue(type.TypeHandle.Value, out constructor))
            {
                constructorCache.Add(type.TypeHandle.Value, constructor = EmitHelper.CreateParameterlessConstructorHandler(type));
            }
            return(constructor());
        }
Пример #2
0
 public override object Instantiate(Type type)
 {
     return(EmitHelper.CreateParameterlessConstructorHandler(type)());
 }