HighTechTalks DotNet Forums  

How to collapse C# XML doc comments like in VB.NET

CSharp microsoft.public.dotnet.languages.csharp


Discuss How to collapse C# XML doc comments like in VB.NET in the CSharp forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Billy
 
Posts: n/a

Default How to collapse C# XML doc comments like in VB.NET - 07-01-2010 , 05:57 AM






Anybody know how I can set environment in C# so that when you will
press "-" sign in front XML doc comment (///) it will collapse like in
VB.NET, With that i mean you will see only summary text and not only
<summary> tag.

Let me show example and results in both languages.

In VB.NET:
''' <summary>
''' Add two whole numbers
''' </summary>
''' <param name="intNr1">First number</param>
''' <param name="intNr2">Second number</param>
''' <returns></returns>
''' <remarks></remarks>
Function AddNumbers(ByVal intNr1 As Integer, ByVal intNr2 As
Integer) As Integer
Return intNr1 + intNr2
End Function

when I press "-" to collapse comment I get nicely only this row above
procedure:

Add two whole numbers
Function AddNumbers(ByVal intNr1 As Integer, ByVal intNr2 As Integer)
As Integer
Return intNr1 + intNr2
End Function

But for same procedure in C#:

/// <summary>
/// Add two whole numbers
/// </summary>
/// <param name="intNr1">First number</param>
/// <param name="intNr2">Second number</param>
/// <returns></returns>
/// <remarks></remarks>
public int AddNumbers(int intNr1, int intNr2)
{
return intNr1 + intNr2;
}

when I press "-" next to the comment I get this:

/// <summary> ...
public int AddNumbers(int intNr1, int intNr2)
{
return intNr1 + intNr2;
}

So what is the point of collapsing of such comment in C# if you cannot
see at the top what is the most important when you collapse comment?

So my quesitons is: How to see same summary also in C# like it is in
VB.NET?

Reply With Quote
  #2  
Old   
Jeff Johnson
 
Posts: n/a

Default Re: How to collapse C# XML doc comments like in VB.NET - 07-01-2010 , 09:18 AM






"Billy" <abil2y (AT) yahoo (DOT) com> wrote


Quote:
So my quesitons is: How to see same summary also in C# like it is in
VB.NET?
You can't. The C# and VB.NET editors are different; it's not just the
languages. In most situations I think the C# experience is superior, but
there are cases where VB.NET has an edge, and this is one of them.

Reply With Quote
  #3  
Old   
Billy
 
Posts: n/a

Default Re: How to collapse C# XML doc comments like in VB.NET - 07-02-2010 , 12:37 AM



On Jul 1, 4:18*pm, "Jeff Johnson" <i.... (AT) enough (DOT) spam> wrote:
Quote:
"Billy" <abi... (AT) yahoo (DOT) com> wrote in message

news:01869f84-5301-4c9d-8ff6-b5af1cf15c94 (AT) x21g2000yqa (DOT) googlegroups.com...

So my quesitons is: How to see same summary also in C# like it is in
VB.NET?

You can't. The C# and VB.NET editors are different; it's not just the
languages. In most situations I think the C# experience is superior, but
there are cases where VB.NET has an edge, and this is one of them.
Yes, I completly agree that C# is more intuitive and more natural, but
that flaw should be implemented by design already.

Reply With Quote
  #4  
Old   
Adam Clauss
 
Posts: n/a

Default Re: How to collapse C# XML doc comments like in VB.NET - 07-02-2010 , 10:19 AM



On 7/1/2010 5:57 AM, Billy wrote:
Quote:
Anybody know how I can set environment in C# so that when you will
press "-" sign in front XML doc comment (///) it will collapse like in
VB.NET, With that i mean you will see only summary text and not only
summary> tag.

Let me show example and results in both languages.

In VB.NET:
'''<summary
''' Add two whole numbers
'''</summary
'''<param name="intNr1">First number</param
'''<param name="intNr2">Second number</param
'''<returns></returns
'''<remarks></remarks
Function AddNumbers(ByVal intNr1 As Integer, ByVal intNr2 As
Integer) As Integer
Return intNr1 + intNr2
End Function

when I press "-" to collapse comment I get nicely only this row above
procedure:

Add two whole numbers
Function AddNumbers(ByVal intNr1 As Integer, ByVal intNr2 As Integer)
As Integer
Return intNr1 + intNr2
End Function

But for same procedure in C#:

///<summary
/// Add two whole numbers
///</summary
///<param name="intNr1">First number</param
///<param name="intNr2">Second number</param
///<returns></returns
///<remarks></remarks
public int AddNumbers(int intNr1, int intNr2)
{
return intNr1 + intNr2;
}

when I press "-" next to the comment I get this:

///<summary> ...
public int AddNumbers(int intNr1, int intNr2)
{
return intNr1 + intNr2;
}

So what is the point of collapsing of such comment in C# if you cannot
see at the top what is the most important when you collapse comment?

So my quesitons is: How to see same summary also in C# like it is in
VB.NET?

If you modify the comment format slightly, it will give you a result
closer to what you want. That is, move the <summary> tags and content
onto a single line:

///<summary>Add two whole numbers</summary>
///<param name="intNr1">First number</param>
///<param name="intNr2">Second number</param>
///<returns></returns>
///<remarks></remarks>
public int AddNumbers(int intNr1, int intNr2)
{
return intNr1 + intNr2;
}

Not necessarily the "standard" way I see C# docs written, but it gives
the result you are looking for.

-Adam

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.