Ejemplo n.º 1
0
        public virtual Task <ITriggerData> BindAsync(TTriggerValue value, ValueBindingContext context)
        {
            Dictionary <string, object> bindingData = Hooks.GetBindingData(value);

            TMessage eventData = Hooks.BindSingle(value, context);

            object userValue = this.Convert(eventData, bindingData);

            string invokeString = _stringConverter(eventData, null, null);

            IValueProvider valueProvider = new ConstantValueProvider(userValue, this.ElementType, invokeString);
            var            triggerData   = new TriggerData(valueProvider, bindingData);

            return(Task.FromResult <ITriggerData>(triggerData));
        }
        public virtual async Task <ITriggerData> BindAsync(TTriggerValue value, ValueBindingContext context)
        {
            Dictionary <string, object> bindingData = Hooks.GetBindingData(value);

            TMessage eventData = Hooks.BindSingle(value, context);

            object userValue = await this.ConvertAsync(eventData, bindingData, context);

            string invokeString = await ConvertToStringAsync(eventData);

            IValueProvider valueProvider = new ConstantValueProvider(userValue, this.ElementType, invokeString);
            var            triggerData   = new TriggerData(valueProvider, bindingData);

            return(triggerData);
        }