[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C# - Any issues associated with method overloads?

Posted on 2011-10-22
2
Medium Priority
?
157 Views
Last Modified: 2012-08-13
I've read about the term overload with constructors.  I can't recall, however, reading about overloads with methods.  I just built the following two overloaded methods.  The compiler seemed happy with them, and both run fine.  Are there any downsides associated with overloaded methods?
            
      public static void ErrorMessage(string errorMessage, string errorCaption)
      // =================================================================================
      // Purpose.: Present a generic error message.
      // =================================================================================
      {
         MessageBox.Show(errorMessage, errorCaption, MessageBoxButton.OK, MessageBoxImage.Error);
      }

      public static void ErrorMessage(string errorMessage, string errorCaption, ExplanationType explanationType, 
         string recordType)
      // =================================================================================
      // Purpose.: Present a error message with an explanation.
      // =================================================================================
      {
         RecordType = recordType;
         BuildExplanation(explanationType);
         MessageBox.Show(errorMessage + explanationMessage, errorCaption, MessageBoxButton.OK, MessageBoxImage.Error);
      }

Open in new window

0
Comment
Question by:jdana
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 37011910
No issues...and it's very common.  

For instance, there are 21 overloads for MessageBox.Show()!
http://msdn.microsoft.com/en-us/library/system.windows.forms.messagebox.show.aspx
0
 

Author Closing Comment

by:jdana
ID: 37027591
24!  That's a lot of overloads.  Thanks!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question