I have a reference to class object that pointed to some class, say, XYZ as follow:
public class XYZ
{
int x;
int y;
int z;
XYZ()
{
x=0;
y=1;
z=2;
}
};
object ObjRef;
ObjRef = new XYZ();
Now, I want to access member variable x, y and z through ObjRef. How can I achieve this?
Thanks in advance.
EDIT :
The class XYZ is inside client's DLL. I have loaded this class using
Assembly MyAssembly = Assembly.LoadFrom(AssemblyName)
Type XYZType = MyAssembly.GetType("XYZ");
Object ObjectRef = Activator.CreateInstance(XYZType);
So i don't have direct access to XYZ. I have Object reference that pointed to XYZ.
ObjReftoXYZto access the members.Assembly.LoadFromhas no reference to the client DLL. Any types defined in it will not be available at compile-time.