public static IReflectionTableBuilder AddEventAttributes(this IReflectionTableBuilder builder, Type type, string eventName, IEnumerable <Attribute> attributes)
        {
            if (type == null)
            {
                throw new ArgumentNullException(nameof(type), $"{nameof(type)} is null.");
            }

            if (string.IsNullOrEmpty(eventName))
            {
                throw new ArgumentException($"{nameof(eventName)} is null or empty.", nameof(eventName));
            }

            if (attributes == null)
            {
                throw new ArgumentNullException(nameof(attributes), $"{nameof(attributes)} is null.");
            }

            EventInfo eventInfo = type.GetTypeInfo().GetEvent(eventName, BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.Instance | BindingFlags.DeclaredOnly);

            if (eventInfo == null)
            {
                throw new ArgumentException($"The type {type.FullName} does not declare an event named \"{eventName}\".");
            }

            return(builder.AddMemberAttributes(eventInfo, attributes));
        }
        public static IReflectionTableBuilder AddMemberAttributes <T>(this IReflectionTableBuilder builder, Expression <Action <T> > expression, IEnumerable <Attribute> attributes)
        {
            var member = Reflect.GetMember <T>(expression);

            if (!member.DeclaringType.Equals(typeof(T)))
            {
                throw new ArgumentException($"The type '{typeof(T).FullName}' does not declare a member '{member.Name}'.");
            }

            return(builder.AddMemberAttributes(member, attributes));
        }
 public static IReflectionTableBuilder AddTypeAttributes <T>(this IReflectionTableBuilder builder, IEnumerable <Attribute> attributes)
 {
     return(builder.AddMemberAttributes(typeof(T), attributes));
 }
 public static IReflectionTableBuilder AddTypeAttributes(this IReflectionTableBuilder builder, Type type, params Attribute[] attributes)
 {
     return(builder.AddMemberAttributes(type, attributes.AsEnumerable()));
 }
        public static IReflectionTableBuilder AddMemberAttributes(this IReflectionTableBuilder builder, Expression <Action> expression, IEnumerable <Attribute> attributes)
        {
            var member = Reflect.GetMember(expression);

            return(builder.AddMemberAttributes(member, attributes));
        }