YamlDotNet.ReflectionExtensions.GetPublicStaticMethod C# (CSharp) Method

GetPublicStaticMethod() public static method

public static GetPublicStaticMethod ( this type, string name ) : MethodInfo
type this
name string
return System.Reflection.MethodInfo
        public static MethodInfo GetPublicStaticMethod(this Type type, string name, params Type[] parameterTypes)
        {
            return type.GetRuntimeMethods()
                .FirstOrDefault(m =>
                {
                    if (m.IsPublic && m.IsStatic && m.Name.Equals(name))
                    {
                        var parameters = m.GetParameters();
                        return parameters.Length == parameterTypes.Length
                            && parameters.Zip(parameterTypes, (pi, pt) => pi.Equals(pt)).All(r => r);
                    }
                    return false;
                });
        }