Created
April 11, 2015 18:32
-
-
Save kalambet/92647c46b64dd2ffaf5f to your computer and use it in GitHub Desktop.
DTO in C# 4 Part6
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
Assembly assembly = Assembly.LoadFrom(@"./delme.ext.dll"); | |
object instance = assembly.CreateInstance("delme.ext.CDelmeExt"); | |
CSharpCallPayload payload = | |
new CSharpCallPayload( | |
RuntimeBinder.GetInstance(), | |
false, | |
false, | |
"WhoAreYou", | |
typeof(object), | |
null); | |
var callSite = CallSite<func<callsite, object,="" bool,="" object="">>.Create(payload); | |
var func = callSite.Target; | |
object str = func.Invoke(callSite, instance, true); | |
if (str is string) | |
MessageBox.Show((string)str); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment