In my small project I’m using System.Reflection classes to produce executable code. I need to call the + operator of a custom type. Does anybody know how can I call customized operator of custom class using C# reflection?
In my small project I’m using System.Reflection classes to produce executable code. I need
Share
C# compiler converts overloaded operator to functions with name
op_XXXXwhereXXXXis the operation. For example,operator +is compiled asop_Addition.Here is the full list of overloadable operators and their respective method names:
So to retrieve the
operator+method of theDateTimestruct, you need to write: