public BindingPropertyResolvers(IBindingExpressionBuilder bindingParser, StaticCommandBindingCompiler staticCommandBindingCompiler, JavascriptTranslator javascriptTranslator, DotvvmConfiguration configuration) { this.configuration = configuration; this.bindingParser = bindingParser; this.staticCommandBindingCompiler = staticCommandBindingCompiler; this.javascriptTranslator = javascriptTranslator; }
public static Expression ParseWithLambdaConversion(this IBindingExpressionBuilder builder, string expression, DataContextStack dataContexts, BindingParserOptions options, Type expectedType, params KeyValuePair <string, Expression>[] additionalSymbols) { if (expectedType.IsDelegate()) { var resultType = expectedType.GetMethod("Invoke").ReturnType; var delegateSymbols = expectedType .GetMethod("Invoke") .GetParameters() .Select((p, index) => new KeyValuePair <string, Expression>( p.Name, Expression.Parameter(p.ParameterType, p.Name) .AddParameterAnnotation(new BindingParameterAnnotation( extensionParameter: new TypeConversion.MagicLambdaConversionExtensionParameter(index, p.Name, p.ParameterType))) )) .ToArray(); return(builder.Parse(expression, dataContexts, options, additionalSymbols.Concat(delegateSymbols).ToArray())); } else { return(builder.Parse(expression, dataContexts, options, additionalSymbols)); } }
/// <summary> /// Initializes a new instance of the <see cref="DefaultControlTreeResolver"/> class. /// </summary> public DefaultControlTreeResolver(DotvvmConfiguration configuration) : base(configuration.ServiceLocator.GetService <IControlResolver>(), configuration.ServiceLocator.GetService <IAbstractTreeBuilder>()) { this.bindingExpressionBuilder = configuration.ServiceLocator.GetService <IBindingExpressionBuilder>(); }
public BindingPropertyResolvers(IBindingExpressionBuilder bindingParser, IViewModelSerializationMapper vmMapper, DotvvmConfiguration configuration) { this.configuration = configuration; this.bindingParser = bindingParser; this.vmMapper = vmMapper; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultControlTreeResolver"/> class. /// </summary> public DefaultControlTreeResolver(IControlResolver controlResolver, IAbstractTreeBuilder treeBuilder, IBindingExpressionBuilder expressionBuilder) : base(controlResolver, treeBuilder) { this.bindingExpressionBuilder = expressionBuilder; }
/// <summary> /// Initializes a new instance of the <see cref="DefaultControlTreeResolver"/> class. /// </summary> public DefaultControlTreeResolver(DotvvmConfiguration configuration) : base(configuration.ServiceLocator.GetService<IControlResolver>(), configuration.ServiceLocator.GetService<IAbstractTreeBuilder>()) { this.bindingExpressionBuilder = configuration.ServiceLocator.GetService<IBindingExpressionBuilder>(); }