Reputation: 3222
Lets assume we have a property like:
private Action<String> actions= null;
Is there a way to actually change the "<>" part of the variable?
For example I would like to change the actions to contain two string inputs instead of one, for example:
private Action<String, String> actions= null;
Any way to do this, if so then how? Maybe with reflection?
Upvotes: 0
Views: 56
Reputation: 61931
The bad news is that what you are asking for cannot be done. Actually, it does not make sense. The notion that you came up with, to dynamically add a generic argument to a type, is rather, eh, how to put it, psyhedelic. (So, suppose you could dynamically change it; what would you do with it? How would you invoke it, when any existing code that uses it expects it to have only one generic argument?)
The good news is that you should not need to do anything of that sort, because there already exists an Action<String,String>
.
Upvotes: 1