C
Claire
I want to pass the type of an object as a field in an object.
public class FileEventArgs : EventArgs
{
public object Data = null;
public Type ClassType = null;
}
In another function, I want to test ClassType. Depending on the Class Type
Data is handled differently.
I can't work out the correct way to do it - the following doesn't work, can
someone help please.
I could do it another way easily but I now wonder what Im doing wrong.
if (e.ClassType == DI225.SerialDriver)
Converter = new DI225.Converter();
else if (e.ClassType == PPC.Driver)
Converter = new PPC.Converter();
public class FileEventArgs : EventArgs
{
public object Data = null;
public Type ClassType = null;
}
In another function, I want to test ClassType. Depending on the Class Type
Data is handled differently.
I can't work out the correct way to do it - the following doesn't work, can
someone help please.
I could do it another way easily but I now wonder what Im doing wrong.
if (e.ClassType == DI225.SerialDriver)
Converter = new DI225.Converter();
else if (e.ClassType == PPC.Driver)
Converter = new PPC.Converter();