static MethodInfo GetMethodFromType(Type type, string methodName, Assembly assembly) {
MethodInfo method = type.GetMethod(methodName);
if (method != null)
return method;
MissingMethodException missingMethod = new MissingMethodException(type.FullName, methodName);
if (assembly != null) {
throw new InvalidOperationException(Res.GetString(Res.XmlSerializerExpired, assembly.FullName, assembly.CodeBase), missingMethod);
}
throw missingMethod;
}