Exemple #1
0
        protected XAttribute GenerateEventHandlerAttribute(AbstractExpression @actions, IdentifierName eventName)
        {
            var handlers = Metadata.EventMap.GetHandlers(eventName);

            if (handlers.Count > 0)
            {
                var attributeName = eventName.AppendPrefixFragments("on").ToString(CasingStyle.Camel);
                var actionKey     = GetEventActionKeyName(eventName);

                return(new JsxExpressionAttribute(
                           attributeName,
                           LAMBDA(@data => DO.RETURN(@actions.DOT(actionKey).INVOKE(@data)))));
            }

            return(null);
        }