J
Johndow
I have trouble to use "Is" operator to a type that is from reflection.
Basically, here is what I want to do, if Class1 type is not from reflection:
class Class1
{
}
public class Test
{
...
if (o is Class1) //to determine if object o is Class1, or is derivative
class of Class1
{
//object o can be cast to type
}
}
Now, Class1 is in different assembly, then I want to the samething, except
getting the Type from reflection
public class Test
{
...
Assembly objAssembly = Assembly.Load("MyDll");
Type t = objAssembly.GetType("MyDll.Class1");
//How to determine if object o is Class1, or is derivative class of Class1
????????
//if (o is Class1)
}
Thank a lot for your kind response
Basically, here is what I want to do, if Class1 type is not from reflection:
class Class1
{
}
public class Test
{
...
if (o is Class1) //to determine if object o is Class1, or is derivative
class of Class1
{
//object o can be cast to type
}
}
Now, Class1 is in different assembly, then I want to the samething, except
getting the Type from reflection
public class Test
{
...
Assembly objAssembly = Assembly.Load("MyDll");
Type t = objAssembly.GetType("MyDll.Class1");
//How to determine if object o is Class1, or is derivative class of Class1
????????
//if (o is Class1)
}
Thank a lot for your kind response