Capturing values from a method call.
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
public override bool TryInvokeMember( | |
InvokeMemberBinder binder, | |
object[] args, | |
out object result) | |
{ | |
_props[binder.Name] = GetValue(args) ?? string.Empty; | |
result = this; | |
return true; | |
} | |
private string GetValue(object[] args) | |
{ | |
if (args.Length > 0) | |
{ | |
var arg = args[0] as string; | |
if (arg != null) | |
{ | |
return arg; | |
} | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment