Catel.Reflection.TypeInfoExtensions.GetEvent C# (CSharp) Method

GetEvent() public static method

Gets the event with the specified name.
The is null. The is null or whitespace.
public static GetEvent ( this typeInfo, string name, BindingFlags bindingFlags ) : EventInfo
typeInfo this The .
name string The name of the member to retrieve.
bindingFlags BindingFlags The binding flags.
return System.Reflection.EventInfo
        public static EventInfo GetEvent(this TypeInfo typeInfo, string name, BindingFlags bindingFlags)
        {
            Argument.IsNotNull("typeInfo", typeInfo);
            Argument.IsNotNullOrWhitespace("name", name);

            return (from x in GetEvents(typeInfo, bindingFlags)
                    where x.Name == name
                    select x).FirstOrDefault();
        }