Skip to content

Instantly share code, notes, and snippets.

@rranelli
Created April 28, 2014 21:57
Show Gist options
  • Select an option

  • Save rranelli/11385251 to your computer and use it in GitHub Desktop.

Select an option

Save rranelli/11385251 to your computer and use it in GitHub Desktop.
public class ClassWithMethodMissing : DynamicObject {
public override bool TrySetMember(SetMemberBinder binder, object value) {
_dictionary[binder.Name] = value;
return true;
}
public override bool TryGetMember(GetMemberBinder binder,
out object result) {
return _dictionary.TryGetValue(binder.Name, out result);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment