|
using System;
using System.Collections.Generic;
using System.Text;
using XPeriment.Persistence.Properties;
using System.Runtime.Remoting;
namespace XPeriment.DataAccessTasks
{
public class BaseTask
{
private static DataTaskPerformer loadedperformer = null;
private PerformerTransaction currenttransaction = null;
public PerformerTransaction CurrentTransaction
{
get
{
return currenttransaction;
}
set
{
currenttransaction = value;
}
}
private string basetable = "";
public DataTaskPerformer Performer
{
get
{
return GetDefaultPerformer();
}
}
public string BaseTable
{
get
{
return basetable;
}
set
{
basetable = value;
}
}
public BaseTask(string baseTable)
{
basetable = baseTable;
}
private DataTaskPerformer GetDefaultPerformer()
{
if (loadedperformer != null)
return loadedperformer;
ObjectHandle objhndl = Activator.CreateInstance(Settings.Default.ProviderAssembly, Settings.Default.ProviderClass);
object performer = objhndl.Unwrap();
if (performer == null)
throw new Exception("Assembly not found!");
else if (!(performer is DataTaskPerformer))
throw new Exception("Data type on setting file is not a data task performer");
else
{
loadedperformer = (DataTaskPerformer)performer;
return loadedperformer;
}
}
}
}
|
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.