hallo,
ist es möglich mit der Erbung von DynamicObject ein Object als eine Methode zu behandeln?
Beispiel:
public class DynamicEvent : DynamicObject
{
public override bool TryInvoke(InvokeBinder binder, object[] args, out object result)
{
// run a special function
result = null;
return true;
}
}
Definition:
public DynamicEvent e;
Aufruf:
e();
C. Anders
Was soll das bringen?
Wenn ich Dich richtig versteh, dann funktioniert das eben mit Actions
public void Run(Action a)
{
a();
}
oder eben Func<>, vielleicht wäre das was für Dich?
- performance is a feature -
Microsoft MVP - @Website - @AzureStuttgart - github.com/BenjaminAbt - Sustainable Code