A
Analizer1
Hi All...
i have a situation where i have 3 different Types (classes)
comming into a controling Class to Run Different Jobs
in my main loop i want to use 1 Field to hold a instance of the Class
currently Running example below
public class controler(
{
// how to use the below process for all 3 different Type?
// this is ccalled each time a run is started in
//different threads from the service
//i want to use one field to hold the current Process
//instead of using 3 Fields and if block
private Process
public controler(int iToRun)
{
if (iToRun==1)
{
Process = new Object1() ;
}
else if (iToRun==2)
{
Process = new Object2();
}
else
{
Process = new Object3();
}
}
public int Runjob()
{
int iRet=0;
if ( (iRet=Process.Execute())<=0)
{
//error occurred
}
else
{
//success
}
}
}
Tia
Analizer1
i have a situation where i have 3 different Types (classes)
comming into a controling Class to Run Different Jobs
in my main loop i want to use 1 Field to hold a instance of the Class
currently Running example below
public class controler(
{
// how to use the below process for all 3 different Type?
// this is ccalled each time a run is started in
//different threads from the service
//i want to use one field to hold the current Process
//instead of using 3 Fields and if block
private Process
public controler(int iToRun)
{
if (iToRun==1)
{
Process = new Object1() ;
}
else if (iToRun==2)
{
Process = new Object2();
}
else
{
Process = new Object3();
}
}
public int Runjob()
{
int iRet=0;
if ( (iRet=Process.Execute())<=0)
{
//error occurred
}
else
{
//success
}
}
}
Tia
Analizer1