I have the following methods:
ShowMessage (string text, string caption) {...}
ShowMessage (string formatText, params object[] parms) {...}
I would like to be able to make the following calls:
ShowMessage ("Display this message in a Message box", "Caption of Message box");
ShowMessage ("Unable to load file {0}", myStringFilename); // Does string.Format using parms
The second call generates error CS0121 about an ambiguous call.
Besides renaming the 2nd member is there a way to disambiguate the 2nd call?
I think to get it to work the way you want, you’ll have to change your second call to this:
I don’t think the C# has the concept of a ‘better’ match to your call. If there’s more than one potential match, you get the error you described.