S
Sylfelin
Hello,
In an object COM of an editor (without source), I have several versions
of an object. ObjectApp1 and ObjectApp2.
ObjectApp2 is a copy of ObjectApp1 but which implements more methods
and properties.
I would like to be able to write a generic class. I try the code below
but that does not compile because the declaration is in the IF
statement.
Has you he a solution for me ?
Thank you
class GenericObjetApp<T>
{
public T myObjetApp
}
class Program
{
static void Main(string[] args)
{
string version = "2";
if (version == "1")
GenericObjetApp<ObjetApp1> app=new GenericObjetApp<ObjetApp1>();
if (version == "2")
GenericObjetApp<ObjetApp2> app=new GenericObjetApp<ObjetApp2>();
app.myObjetApp.Close();
}
}
In an object COM of an editor (without source), I have several versions
of an object. ObjectApp1 and ObjectApp2.
ObjectApp2 is a copy of ObjectApp1 but which implements more methods
and properties.
I would like to be able to write a generic class. I try the code below
but that does not compile because the declaration is in the IF
statement.
Has you he a solution for me ?
Thank you
class GenericObjetApp<T>
{
public T myObjetApp
}
class Program
{
static void Main(string[] args)
{
string version = "2";
if (version == "1")
GenericObjetApp<ObjetApp1> app=new GenericObjetApp<ObjetApp1>();
if (version == "2")
GenericObjetApp<ObjetApp2> app=new GenericObjetApp<ObjetApp2>();
app.myObjetApp.Close();
}
}