- smartmassemail_src.zip
- SmartMassEmailSrc
- AssemblyInfo.cs
- bin
- EntLibHelper
- ImplementedProvidersDiagram.png
- ImplementedProvidersDiagram.psd
- Providers
- Configuration
- Providers.csproj
- Providers.csproj.user
- System
- Configuration
- Providers
- Providers
- EmailDeQueueProvider
- EmailDispatchProvider
- EmailQueueProvider
- EmailTemplateProvider
- ProcessFailureProvider
- Provider.cs
- References
- Microsoft.Practices.EnterpriseLibrary.Caching.Cryptography.dll
- Microsoft.Practices.EnterpriseLibrary.Caching.dll
- Microsoft.Practices.EnterpriseLibrary.Common.dll
- Microsoft.Practices.EnterpriseLibrary.Data.dll
- Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll
- Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll
- Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll
- Microsoft.Practices.EnterpriseLibrary.Logging.dll
- Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.dll
- Microsoft.Practices.EnterpriseLibrary.Security.dll
- Microsoft.Practices.ObjectBuilder.dll
- nunit.framework.dll
- SmartMassEmailPropertySet.xml
- SmartMassEmail.Data.SqlClient
- SmartMassEmail.Data
- SmartMassEmail.Entities
- SmartMassEmail.ImplementedProviders
- SmartMassEmail.Sql2000.Service
- SmartMassEmail.Sql2005.Service
- SmartMassEmail.WebApplication.Sql2000
- SmartMassEmail.WebApplication.Sql2005
- SmartMassEmailSolution.gpState
- SmartMassEmailSolution.sln
- UpgradeLog.XML
- UpgradeLog2.XML
|
using System;
using System.Text;
using System.Reflection;
using System.ComponentModel;
using System.ComponentModel.Design.Serialization;
namespace SmartMassEmail.Entities
{
/// <summary>
/// Provides a unified way of converting types of values to other types, as well as for accessing standard values and subproperties.
/// Used by the nettiers strongly typed collection, so they can be saved in ViewState.
/// </summary>
public class GenericTypeConverter : TypeConverter
{
/// <summary>
/// Initializes a new instance of the <see cref="GenericTypeConverter"/> class.
/// </summary>
public GenericTypeConverter()
{
}
/// <summary>
/// Returns whether this converter can convert the object to the specified type.
/// </summary>
public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType)
{
if(destinationType == typeof(InstanceDescriptor))
return true;
return base.CanConvertTo(context,destinationType);
}
/// <summary>
/// Converts the given value object to the specified type.
/// </summary>
public override object ConvertTo(ITypeDescriptorContext context,
System.Globalization.CultureInfo culture,
object val,Type destinationType)
{
if(destinationType == typeof(InstanceDescriptor))
{
Type valueType = val.GetType();
ConstructorInfo ci = valueType.GetConstructor(System.Type.EmptyTypes);
return new InstanceDescriptor(ci,null,false);
}
return base.ConvertTo(context,culture,val,destinationType);
}
}
}
|
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.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here