如下例所示:
switch ( myObj.GetType ( ) ) { case typeof(MyObject): Console.WriteLine ( "MyObject is here" ); break; }
.net c# reflection switch-statement
.net ×1
c# ×1
reflection ×1
switch-statement ×1