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

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?
0
Billy
7/1/2010 10:57:32 AM
dotnet.languages.csharp 1931 articles. 0 followers. Follow

3 Replies
1719 Views

Similar Articles

[PageSpeed] 4

"Billy" <abil2y@yahoo.com> wrote in message 
news:01869f84-5301-4c9d-8ff6-b5af1cf15c94@x21g2000yqa.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. 


0
Jeff
7/1/2010 2:18:57 PM
On Jul 1, 4:18=A0pm, "Jeff Johnson" <i....@enough.spam> wrote:
> "Billy" <abi...@yahoo.com> wrote in message
>
> news:01869f84-5301-4c9d-8ff6-b5af1cf15c94@x21g2000yqa.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.
0
Billy
7/2/2010 5:37:12 AM
On 7/1/2010 5:57 AM, Billy wrote:
> 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
0
Adam
7/2/2010 3:19:04 PM
Reply:

Similar Artilces:

Collapsing/Expanding Columns
Is it possible to use the subtotal (or another tactic) to collapse an expand columns with buttons. I used Data/Subtotal to collapse rows an then deleted the unnecessary total rows, but I can't get it wit columns. Any help is appreciated. Thanks ~kremla -- Message posted from http://www.ExcelForum.com Hi kremlap Sure. Select any row(s) or column(s) and go menu Data > Group and outline > Group. ....and it's Ungroup to set things back to normal. And groups can contain groups, if you want a hierarchy. -- HTH. Best wishes Harald Followup to newsgroup only please. "krem...

Can't send e-mails (most likely different problem than the other one)
It won't let me send e-mails: ...reported error (0x800CCC0F): the connection to the server was interrupted... and when I do "Test Account Settings": ...Outlook could not logon to the outgoing mail server (SMPT). The problem could be the server name... ------------------------------------------------ ~~ Message posted from http://www.OutlookForum.com/ ~~ View and post usenet messages directly from http://www.OutlookForum.com/ ...

Working with an Embedded XML File
Hello all, I have a basic XML file of which I set the Build Action to "Embedded Resource" The XML file is simple: <root> <item> <name>Test Name</name> <description>Test Description</description> </item> </root> I'm having a heck of a time reading the xml file embedded in the assembly. I'm more than certain that I'm missing some sort of name space element in the XML.. I've searched high and low and I am unable to find any sample code that works. I get errors such as invalid object, etc. I was hopin...

XML Serialization without Attributes?
Hello, I'm programming with Visual Studio 2005 for .net 2.0 in C#. Very often I use XML Serilization [1]. Some of the output files can be edited by the user with an external editor. What I don't like are some attributes which are inserted into the fily by the serializer, and which may confuse the user. Example: | <?xml version="1.0"?> | <Summary xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd = "http://www.w3.org/2001/XMLSchema"> | <CurrentCQI> | <Incident> | <CQI> <sn...

How to append records in exist XMl file?
Greetings I want to append records in a XML file,I use XMLTextWriter,but i found it only create a XML file,not append records in exist XML file.why? ------------------------------------------------- XmlTextWriter myXmlTextWrite = new XmlTextWriter(@"C:\myconfig.xml"); myXmlTextWrite.WriteStartDocument(); myXmlTextWrite.WriteStartElement("Record"); myXmlTextWrite.WriteStartElement("Topic"); myXmlTextWrite.WriteString(XMLTopic); myXmlTextWrite.WriteEndElement(); myXmlTextWrite.WriteEndElement(); //end Record myXmlTextWrite.WriteEndDocument(); myXmlTextWrite.Flush(...

XML in Access 2003: IXMLDOMNode- Invalid Character in Content Mode
-- SHC ...

Problem with XML/XSLT and C#
Hi everyone, I have a web application that reads the contents of a web form and creates an XML file from it. Next it creates an HTML file using an XSLT file. However, I sometimes get weird characters in my final HTML. Is there a way to fix this? Maybe an additional directive I can add here. Following is the part where this happens <h2>Product Request</h2> <table> <tr> <td>Type:</td> <td><xsl:value-of select="Order"/></td> </tr> <tr> <td>License Type:</td> <td><xsl:value-of select="Licen...

Transforming part of the XML
Hi all, I am trying to transform part of the XML in a file using XSLT. I select my node by a XPathNavigator and pass it to an XslTranform to Transform that. But unfortunately it transforms the whole XML document instead of part of it. Is there any way that I can transform only the part selected by XPathNavigator? Thanks. fix. fix wrote: > I am trying to transform part of the XML in a file using XSLT. I select > my node by a XPathNavigator and pass it to an XslTranform to Transform > that. But unfortunately it transforms the whole XML document instead of > part of it. Is...

Search SOP Sales Line Item Comment Lines
I am trying to use Smartlist to search the SOP sales line item comments. I can find the SOP Document comments, but how do i link the Sales Line Item Comments to a Smartlist Debbie Debbie, I don't see the sales line item comments as available fields in the Sales Line Item SmartList. I see Comment 1, Comment 2, etc., but those are bringing in the comments from the SOP Transaction (header), not the line items. I don't know if that is by design or was overlooked. In any case, doesn't look like there is a way to bring those in without using SmartList Builder at this point....

Top Row on Excel has changed to 1, 2, 3... in lieu of A, B, C?
Somehow I have changed the column lable from letters - A - B - C .... to 1, 2, 3? Its driving me crazy and I dont know how to change back? Help!!!! In XL2003...Tools.Options.General....UN-check: R1C1 Style In XL2007...OfficeButton.Excel_Options.Formulas....UN-check: R1C1 Style Does that help? -- Ron Coderre Ron Coderre Microsoft MVP-Excel (2006-2010) ------------------------------------------------------------------------ Ron Coderre's Profile: 1451 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=178747 [url=&quot;http://www.thecodecag...

I would like to be able to run Outlook from my U3 USB Smart Drive.
I would like to be able to run Outlook from my U3 USB Smart Drive. Please explain whether and how it can be done? Regards, Amiram Not possible since Outlook does not support the U3 platform. -- Robert Sparnaaij [MVP-Outlook] Coauthor, Configuring Microsoft Outlook 2003 http://www.howto-outlook.com/ Outlook FAQ, HowTo, Downloads, Add-Ins and more http://www.msoutlook.info/ Real World Questions, Real World Answers ----- "AkhPotter" <AkhPotter@discussions.microsoft.com> wrote in message news:6E9F6F33-3F94-4674-B54A-CC516B6FA5B6@microsoft.com... > I...

Content in Excel to Xml Question
Hi all, I am writing a macro to import the data from Excel(includes numbers, alphanumeric, other languages) to xml. I am able to get almost everything in the same way which I wanted to however, I am not able to get one description written in Japanese Language. I am getting all Question marks instead and all other languages like French or Italian are been displayed properly. I tried to get the output in IE 7, Notepad and the result is the same..all Question marks. Can you please suggest any solution. Thanks Praveen KP. ...

de-serialize part of xml document
Hi, what happens if my classes don't include every element/attribute that can be found in the xml file, i.e. I don't implement the entire schema. Will I get just the elements I'm asking for? -- Daniel yes! It should be easy to try this. "Daniel Lidstr´┐Żm" <someone@microsoft.com> wrote in message news:10fz80bhoo9xr.1ci8r9oqo7shj.dlg@40tude.net... > Hi, > > what happens if my classes don't include every element/attribute that can > be found in the xml file, i.e. I don't implement the entire schema. Will I > get just the elements I'm aski...

Load an XML dataset from a saved Diffgram
In order to allow for "offline" operation, when my application exits, it saves a copy of the complete dataset as a diffgram file using the following statement. mydataset.writexml("c:\mydata.xml",xmlwritemode.diffgram) The orginal dataset was retrieved from a web service and this happens regardless of whether the update is successful or not. This is to allow for startup even if service is unavailable. If the internet/web service is not available, I'd like to be able to load the previous copy using a statement like. mydataset.readxml("c:\mydata.xml",...

"select distinct" in Fetch XML
Does FetchXML have anything which is the equivalent of the SQL select distinct Clause? I've worked out the syntax to do a join across my tables (note to MS - an example in the documentation would have helped!) but now get multiple results so unless FetchXML can do a select distinct it seems to be necessary to record every possible result and then calculate the unqiue results in my code. Obviously a select distinct would avoid this step but unless I'm missing something then its not capable of doing that. Any suggestions? TIA there is no support in the current release of crm fo...

XML
I have created a stored procedure that generates an XML file. The only issue is that the namespace is being duplicated in each of the detail elements and I only want it to appear in the root. I am including my code and any help would be greatly appreciated! TIA, Mary This is just a brief display of what I am trying to produce ..... <submission namespace data .....> <header_record> detail elements </header_record> <detail_record ID="123"> detail elements </detail_record> <detail_record ID=&...

WF4 : The Activities property is 'ReadOnly' in VB, not in C# ?
Hello. In order to learn WF4 I have read "A Developer's Introduction to Windows Workflow Foundation (WF) in .NET 4" (http://msdn.microsoft.com/en-us/library/ee342461.aspx). Unfortunately it is in C# while my preferred language is VB. So I try to translate. The first example is the following: [TestMethod] public void TestHelloWorldStatic() { StringWriter Sw = new StringWriter(); Console.SetOut(Sw); Sequence Wf = new Sequence { Variables = { ...

RE: VB & Common Dialog???
Gentlemen & Women, I am trying to assign a file path (with out the file name) to a variable and am having some difficulty using the common dialog. For example... I have a variable strTest I want it to contain the path c:\job\new Not c:\job\new\somename.doc so that ... strTest = "c:\job\new" Can I do this with the common dialog, or is it a different control? thanks. -ps "theBlueFox" <my@email.usa> wrote in message news:ufwvStE%23KHA.4652@TK2MSFTNGP06.phx.gbl... > I am trying to assign a file path (with out the file name)...

Is it possible to make comments font larger by default?
rather than manipulating every comment I put in? You can make the font size different by default as well as the font color and background color but you can't change the font typeface itself. It will continue to use Tahoma. The change has to be made in the Windows Display Properties dialog box. Right click the Desktop, select Properties, select the Appearance tab, click on the Advanced button, then in the Item drop-down list select ToolTip andmake your changes. You will, of course, be affecting the appearance of tool tips in other programs as well, but at least you won't be s...

VB Question
I am wondering if it is possible to change the WHERE clause of this statement to select the current record of a form. Lets say on a search form a user searchs for a record, i would like them to be able to press a button and have that record put into another table. I have generated this code ( which is pretty much and append query) but im wondering if how i can put this into VB code and how i can change the WHERE clause to select the current record on a from. INSERT INTO SRMisc ( [Tracker Item], Description, Comments, Requestor, [SR Num] ) SELECT Tracker.X5, Tracker.Z1, Tracker.Z2, Tracker....

Databindings and XML
Dear Group I wonder if I do something wrong and whether this is possible at all. Any hint is greatly appreciated. I have a XML file bound to a Treeview. The treenodes Text/Value properties bind and populate fine if I set them to an attribute of the XML tag. What I would like to do however is setting my nodes text and value property to text that is between the XML tags. Example: <products> <article value="1" text="Washing Powder"> <description text="Super Whitewash"> Super Whitewash is ideal and a 'must hav...

Is it possible to define a schema that a xml tag can contains xml or text?
so xml could look like <field>test</field> or <field><test>this is a test</test></field> thanks! davidw wrote: > so xml could look like > > <field>test</field> > > or > > <field><test>this is a test</test></field> Example for mixed contents that allows both your above examples: <xs:element name="field" maxOccurs="unbounded"> <xs:complexType mixed="true"> <xs:sequence> <xs:element name="test&q...

net display #5
having problem loading net display configured dual monitors and everything works except recipt converted the xml to htm and when asked to locate the file it says "the net display is busy and could not load the specific net display receipt file please try again...thanks ...

Uing Visio 11 Drawing Control in ASP.Net ?
Hi, I developed a small application which uses Visio 11 Drawing ActiveX Control to demonstrate Business Process Flow creation using VISIO and VB.Net. This application is working fine in my Desktop. Now I am trying to focus on Web using ASP.Net for collaborative environment. Can you please tell me how to integrate Visio Drawing control in ASP.net., when I include the same in ASP.Net I am not getting the all the properties and methods of the Control. If you provide some help, it will helpful for me to demostrate how this Drawing Control will be used on Web for Business Process Modeling. I thin...

Sorting problem with Crystal in VB.Net 2008
The foloowing code generates an error; what's wrong with the code? Invalid Index. (Exception from HRESULT:0x800200B (DISP_E_BADINDEX) dim sSortBy as string = "MySortField" Dim FieldDef As FieldDefinition FieldDef = crDoc.Database.Tables(0).Fields(sSortBy) crDoc.DataDefinition.SortFields(0).Field = FieldDef crDoc.DataDefinition.SortFields(0).SortDirection = CrystalDecisions.[Shared].SortDirection.DescendingOrder ViewReport.CrViewer1.ReportSource = crDoc ...