Is there a way to “create” a method name?

Okay, this might be bad practice, but I have three methods, Event1, Event2, and Event3.

I want to choose which event to call based on parameters that I'm passing to another function, chooseEvent(int number);

so that if I pass in something like chooseEvent(1), I'll call Event1. Is this possible? I tried doing something like "event"+number(); but that didn't work haha.

by byviolet via /r/csharp

Leave a Reply