Exemplo n.º 1
0
        public bool RaiseEvent(string eventName, object[] args)
        {
            if (RaiseEventCalled == null)
                return false;

            var eventArgs = new EventShareEventArgs(eventName, args);
            RaiseEventCalled(eventArgs);
            return eventArgs.EventHandlerFound;
        }
Exemplo n.º 2
0
        public void EventRaised(EventShareEventArgs args)
        {
            // this is an event property
            foreach (var handler in _EventHandlers.Where(e => e.CanBeInvoked(args.EventArgs)))
            {
                args.EventHandlerFound = true;
                handler.Invoke(args.EventArgs);
            }

            // - or -

            // this has an event property
            if (Values.ContainsKey(args.EventName) && Values[args.EventName] is MockBuilder)
                (Values[args.EventName] as MockBuilder).EventRaised(args);
        }