Last active
January 12, 2018 13:39
-
-
Save ForNeVeR/8492737 to your computer and use it in GitHub Desktop.
Static class creation test.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Reflection; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var allocate = typeof(RuntimeTypeHandle).GetMethod("Allocate", BindingFlags.NonPublic | BindingFlags.Static); | |
var math = allocate.Invoke(null, new[] { typeof (Math) }); | |
Console.WriteLine(math.GetType()); // System.Math | |
Console.WriteLine(math is Math); // True | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment