Print Solution

Is there a way to print an entire C# solution or do you have to select one file at a time and print

Thanks Steve


Answer this question

Print Solution

  • James Divine

    Sorry it may be obvious to you but I am still a newb at this...
     
    Why would you even have two methods   Can't you use the optional keyword in the declaration like:


    private void TestOutput(optional String strHelloName)
     

    to cover both conditions

    So what I am assuming is if another method calls TestOutput() the first is called if it calls TestOutput(strUserName) then the second function is called.

    I would have to assume also that you could not have two TestOutput methods with both taking a string, but one could have a string and the other an integer.


  • zadcoe

    1)  C# doesn't have optional parameters, only VB.NET does.  This is why you'll often see far more methods in a C# project than a VB.NET project.

    2)  You are correct, you could not have 2 methods of the same name both with a String as a parameter.  Each method would need a different set of parameters.



  • RyanB88

    This is very common in C#.  For example:


    private void TestOutput()
    {
      Console.WriteLine("Hello World");
    }

    private void TestOutput(String strHelloName)
    {
      Console.WriteLine("Hello " + strHelloName);
    }

     



  • hoowahfun

    Could you explain to me what the writer means by "calling another overload of the same routine"  I understand how both methods work but I would have thought the second method PrintItemsInSelectedProject would need to be called something else before the first methind would be able to call it.


  • Phoenix wolfe

    VS.NET does not supply a means for doing this automatically, but here's an MSDN article on how to create a macro to achieve what you are looking to do:

    http://msdn.microsoft.com/library/default.asp url=/library/en-us/dncodefun/html/code4fun05302003.asp


    Hope this helps,
    Josh

  • Zeeshan

    I didn't think it was possible to have two functions with the same name.

  • Fabita

    Thank you for all of the help.

  • new2

    There are 2 functions with the same name, but different parameters: 
      Sub PrintItemsInSelectedProject()
      and
      Sub PrintItemsInSelectedProject(ByVal projitems As ProjectItems)

    The author is attempting to state that the first function is calling the 2nd, and the 2nd function is just an overload of the first.

    Glad I could help,
    Josh Lindenmuth 


  • Print Solution