- publisher.zip
- Sumeru.Publisher.FTPPublisher
- Sumeru.Publisher.Loader
- Sumeru.Publisher
|
using System;
using System.Reflection;
namespace Sumeru.Publisher.Framework
{
/// <summary>
/// Summary description for PublisherFactory.
/// </summary>
public abstract class PublisherFactory
{
private PublisherFactory()
{
}
/// <summary>
/// Creates the publisher and return a type of IPublisher
/// </summary>
/// <param name="assembly">The path to the assembly</param>
/// <param name="className">The class name to instantiate</param>
/// <param name="settings">The settings collection</param>
/// <returns></returns>
public static IPublisher CreatePublisher(string assemblyName, string className, Sumeru.Publisher.Framework.Data.SettingCollection settings)
{
try
{
IPublisher ipub;
Assembly asm=Assembly.LoadFrom(assemblyName);
System.Type type=asm.GetType(className);
object pub=Activator.CreateInstance(type);
ipub=(IPublisher) pub;
ipub.Init(settings);
return ipub;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
|
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.
Architect, Developer, Speaker | Wannabe GUT inventor & Data Scientist | Microsoft MVP in C#