@@ -113,7 +113,8 @@ public static BslValue WrapClrObjectToValue(object value)
113113 } ;
114114 }
115115
116- public static BslValue ConstructorCall ( ITypeManager typeManager , IServiceContainer services , string typeName , IBslProcess process , BslValue [ ] args )
116+ public static BslValue ConstructorCall ( ITypeManager typeManager , IServiceContainer services ,
117+ string typeName , IBslProcess process , BslValue [ ] args )
117118 {
118119 var type = typeManager . GetTypeByName ( typeName ) ;
119120 var factory = typeManager . GetFactoryFor ( type ) ;
@@ -128,6 +129,22 @@ public static BslValue ConstructorCall(ITypeManager typeManager, IServiceContain
128129 return ( BslValue ) factory . Activate ( context , args . Cast < IValue > ( ) . ToArray ( ) ) ;
129130 }
130131
132+ public static BslValue DynamicConstructorCall ( ITypeManager typeManager , IServiceContainer services ,
133+ string typeName , IBslProcess process , IValue [ ] args )
134+ {
135+ var type = typeManager . GetTypeByName ( typeName ) ;
136+ var factory = typeManager . GetFactoryFor ( type ) ;
137+ var context = new TypeActivationContext
138+ {
139+ TypeManager = typeManager ,
140+ Services = services ,
141+ TypeName = type . Name ,
142+ CurrentProcess = process
143+ } ;
144+
145+ return ( BslValue ) factory . Activate ( context , args ) ;
146+ }
147+
131148 // TODO: Сделать прямой маппинг на статические фабрики-методы, а не через Factory.Activate
132149 public static T StrictConstructorCall < T > ( ITypeManager typeManager , IServiceContainer services ,
133150 string typeName , IBslProcess process , BslValue [ ] args )
0 commit comments