public void Provide(Type type, ComponentData data)
        {
            var attr = Attribute.GetCustomAttributes(type)
                       .OfType <EventAttribute>()
                       .SingleOrDefault();

            if (attr != null)
            {
                data.IsEvent(true);
                data.SetEventBindToEntity(attr.bindToEntity);
                data.SetEventType(attr.eventType);
                data.SetEventPriority(attr.priority);
            }
            else
            {
                data.IsEvent(false);
            }
        }
        public void Provide(Type type, ComponentData data)
        {
            var attrs = Attribute.GetCustomAttributes(type)
                        .OfType <EventAttribute>()
                        .ToArray();

            if (attrs.Length > 0)
            {
                data.IsEvent(true);
                var eventData = attrs
                                .Select(attr => new EventData(attr.eventTarget, attr.eventType, attr.priority))
                                .ToArray();

                data.SetEventData(eventData);
            }
            else
            {
                data.IsEvent(false);
            }
        }
        ComponentData[] createDataForEvents(ComponentData data)
        {
            var componentName = data.GetTypeName().ToComponentName(_ignoreNamespacesConfig.ignoreNamespaces);

            return(data.GetContextNames()
                   .Select(contextName => {
                var dataForEvent = new ComponentData(data);
                dataForEvent.IsEvent(false);
                var optionalContextName = dataForEvent.GetContextNames().Length > 1 ? contextName : string.Empty;
                var listenerComponentName = optionalContextName + componentName + "Listener";
                dataForEvent.SetlTypeName(listenerComponentName.AddComponentSuffix());
                dataForEvent.SetMemberData(new[] {
                    new MemberData("I" + listenerComponentName, "value")
                });
                dataForEvent.SetContextNames(new[] { contextName });
                return dataForEvent;
            })
                   .ToArray());
        }
        ComponentData[] createDataForEvents(ComponentData data)
        {
            var componentName = data.GetTypeName().ToComponentName(_ignoreNamespacesConfig.ignoreNamespaces);

            return(data.GetContextNames()
                   .SelectMany(contextName =>
                               data.GetEventData().Select(eventData => {
                var dataForEvent = new ComponentData(data);
                dataForEvent.IsEvent(false);
                dataForEvent.IsUnique(false);
                var eventTypeSuffix = eventData.GetEventTypeSuffix();
                var optionalContextName = dataForEvent.GetContextNames().Length > 1 ? contextName : string.Empty;
                var listenerComponentName = optionalContextName + componentName + eventTypeSuffix + "Listener";
                dataForEvent.SetTypeName(listenerComponentName.AddComponentSuffix());
                dataForEvent.SetMemberData(new[] {
                    new MemberData("System.Collections.Generic.List<I" + listenerComponentName + ">", "value")
                });
                dataForEvent.SetContextNames(new[] { contextName });
                return dataForEvent;
            }).ToArray()
                               ).ToArray());
        }