I want to change the type with which I am comparing in an "is" statement at runtime, which I believe is not possible with "is" if i understand this Q&A right But I don't fully understand the answer given there,
could somebody please give an example on how to make a working type comparison with a changeable type ?
Similar to what I have tried here : //does not work (at least not with my c# ;-) )
public static Type T;
public class A { }
public class B { }
public static void Main(string[] args)
{
A AObject = new A();
T = typeof(A);
Console.WriteLine(AObject is T); // schould print true if it worked
T = typeof(B);
Console.WriteLine(AObject is T); // should print false if it worked
Console.Read();
}
The Question linked as Reason for closing this one is not considered a good on topic question I agree with that, I have a simple question for a topic that schould be simple and I want a simple answer and not a Tips and trics guide, that is not even considered fitting for this Q&A Format.
And I got that simple answer Thanks verry much !