Created
August 8, 2010 13:30
-
-
Save chaliy/514022 to your computer and use it in GitHub Desktop.
reateObjWithInvoike
This file contains hidden or 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
class Program | |
{ | |
public static void Main() | |
{ | |
var ctor = typeof (R).GetConstructor(new Type[] {typeof (string)}); | |
var result = (R)ctor.Invoke(new object[]{"a"}); | |
result.Test(); | |
} | |
} | |
public class R | |
{ | |
public R(string stuff) | |
{ | |
} | |
private string _test = "test"; | |
public void Test() | |
{ | |
Console.WriteLine(_test); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment