Example #1
0
        public override void Initialize()
        {
            //Get the event info to access event in the target object
            EventInfo eventInfo = TargetObject.GetType().GetEvent(Expression.TargetField, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);

            if (eventInfo == null)
            {
                throw new Exception("EventBinding : event with name " + Expression.TargetField + " does not exists in element of type " + TargetObject.GetType());
            }

            _eventProxy = new EventToCommandProxy(TargetObject, eventInfo, Expression.CommandParameter);
            _eventProxy.Attach();
        }
Example #2
0
        public override void Initialize()
        {
            //Get the event info to access event in the target object
            EventInfo eventInfo = TargetObject.GetType().GetEvent(Expression.TargetField, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase);

            if (eventInfo == null)
            {
                throw new Exception("EventBinding : event with name " + Expression.TargetField + " does not exists in element of type " + TargetObject.GetType());
            }

            _eventProxy = new EventToCommandProxy(TargetObject, eventInfo, Expression.CommandParameter);
            _eventProxy.Attach();
        }