J
Jamie McQuay
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.SelectedObject = (A)myObject;
}
else if (myObject is B)
{
propertyGrid.SelectedObject = (B)myObject;
}
is there a way to do something like the following?
Type myType = myObject.GetType();
propertyGrid.SelectedObject = (myType )myObject;
Thanks,
Jamie
of types to determine the type to cast to.
For example
if (myObject is A)
{
propertyGrid.SelectedObject = (A)myObject;
}
else if (myObject is B)
{
propertyGrid.SelectedObject = (B)myObject;
}
is there a way to do something like the following?
Type myType = myObject.GetType();
propertyGrid.SelectedObject = (myType )myObject;
Thanks,
Jamie