|
using System;
using System.Configuration;
using System.Threading;
using System.Web.Compilation;
namespace PauloMorgado.Web.Configuration
{
internal static class TypeUtils
{
internal static Type GetType(string typeName, string propertyName, ConfigurationElement configurationElement)
{
Type type;
try
{
type = BuildManager.GetType(typeName, true, false);
}
catch (Exception exception)
{
if (((exception is ThreadAbortException) || (exception is StackOverflowException)) || (exception is OutOfMemoryException))
{
throw;
}
if (configurationElement != null)
{
throw new ConfigurationErrorsException(exception.Message, exception, configurationElement.ElementInformation.Properties[propertyName].Source, configurationElement.ElementInformation.Properties[propertyName].LineNumber);
}
throw new ConfigurationErrorsException(exception.Message, exception);
}
return type;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.