Anyone know how to cast an object to the type stored in a System.Type
variable? I need to cast m_oValue to an int, bool, ect... based on the
variable Type.
public class TestClass
{
private object m_oValue;
public System.Type Type;
public object Value
{
get { return m_oValue; }
set
{
if (Type2 == null) m_oValue = value;
else
{
// the line below doesn't work
// trying to cast value to this.Type
// m_oValue = (typeof(this.Type)) value;
}
}
}