private IProcessingStep GetIProcessingStep()
{
if (processingStep == null)
{
string processingType = ConfigurationManager.AppSettings["IProcessingStep"];
if (!string.IsNullOrEmpty(processingType) && processingType.Split(';').Length == 2)
{
string assemblyName = processingType.Split(';')[0];
string typeName = processingType.Split(';')[1];
if (assemblyName.ToLower().EndsWith(".dll"))
assemblyName = string.Join(".", assemblyName.Split('.').Reverse().Skip(1).Reverse());
var obj = Activator.CreateInstance(assemblyName, typeName).Unwrap();
if (obj is IProcessingStep)
processingStep = obj as IProcessingStep;
}
}
if (processingStep != null)
return processingStep;
else
throw new Exception("Could Not Create IProcessingStep from AppSettings");
}