You simply can't change how a class behaves like this.
Method groups are only used in method invocation expressions and when creating delegate instances.
If you want a class which can behave dynamically like this, you should perhaps look at ExpandoObject
. Or if you want to be able to make your OneMethod
class do something based on a delegate which varies, you can easily hook that up simply enough using a field of the relevant delegate type:
class C {
private Action<string> action = delegate {};
public void OneMethod(string s) {
action(s);
}
public void ChangeMethods() {
action = delegate(string s) { };
}
}
It's somewhat unusual to want to do this, admittedly.