I receive an object from an event and I need to go through a long list
of types to determine the type to cast to.
For example
if (myObject is A)
{
propertyGrid.Se lectedObject = (A)myObject;
}
else if (myObject is B)
{
propertyGrid.Se lectedObject = (B)myObject;
}
is there a way to do something like the following?
Type myType = myObject.GetTyp e();
propertyGrid.Se lectedObject = (myType )myObject;
Thanks,
Jamie
Comment