Is there a way to simplify the process of adding an overloaded method in C # using VS2005?
In VB6 I would just add an Optional parameter, but in C # I would need to introduce a new new method with this new parameter?
as of c # 2.0 there is only a way with code generation tools. resharper could do it. with additional options C # 4.0 is also possible.
Yes. In C # 4.0 you can use optional parameters, but in C # 2.0 you have to specify them manually.
You can do it with .net 4.0:
1: public void SendMail(string toAddress, string bodyText, bool ccAdministrator = true, bool isBodyHtml = false) 2: { 3: // Full implementation here 4: }
In an earlier version, you need to write separate methods.
C # 4.0 has optional parameters - see programming guide .