+2007-01-04 Igor Zelmanovich <igorz@mainsoft.com>\r
+\r
+ * PageMapper.cs: refactoring: \r
+ GetCachedType, GetObjectType - added overloads\r
+\r
2006-08-20 Vladimir Krasnov <vladimirk@mainsoft.com>\r
\r
* BaseHttpServlet.cs: merged TLS fixes, workaround for thread problem\r
public static Type GetObjectType(string url)
{
- return GetCachedType(NormalizeName(url));
+ return GetCachedType(NormalizeName(url), true);
+ }
+
+ public static Type GetObjectType (string url, bool throwException) {
+ return GetCachedType (NormalizeName (url), throwException);
}
public static Assembly GetObjectAssembly(string url)
return t;
}
- private static Type GetCachedType(string url)
+ private static Type GetCachedType (string url) {
+ return GetCachedType (url, true);
+ }
+ private static Type GetCachedType (string url, bool throwException)
{
ICachedXmlDoc doc = PageMapper.GetAssembliesCachedDocument();
Type t = doc.GetType(url);
- if (t == null)
+ if (t == null && throwException)
throw new HttpException(404,"The requested resource (" + url + ") is not available.");
return t;
//PageMapper call
string virtualPath = "~/App_Code/ProfileCommon";
string resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPath).TrimEnd ('/');
- profileBaseType = PageMapper.GetObjectType (resolvedUrl);
+ profileBaseType = PageMapper.GetObjectType (resolvedUrl, false);
}
return profileBaseType;
}
if (profileGroupType == null) {
//PageMapper call
string virtualPath = "~/App_Code/ProfileGroup" + groupName;
- string resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPath).TrimEnd ('/');
- profileGroupType = PageMapper.GetObjectType (resolvedUrl);
+ string resolvedUrl = System.Web.Util.UrlUtils.ResolveVirtualPathFromAppAbsolute (virtualPath).TrimEnd ('/');\r
+ profileGroupType = PageMapper.GetObjectType (resolvedUrl, false);
}
return profileGroupType;
}