xml-comments

Using C#'s XML comment cref attribute with params syntax

萝らか妹 提交于 2019-11-30 11:48:42
问题 In C#, I am trying to use <see cref="blah"/> to reference a method signature that contains the params keyword. I know this converts the parameter list to an array, but I can't even figure out how to refer to an array in a CREF attribute. I am finding nothing in my searches and no one I know has any idea, either. The compiler is choking on the square brackets. I've tried all kinds of different combinations, using curly braces, using the Array class, but nothing is working. Does anyone know

Code documentation: How much is too much?

自作多情 提交于 2019-11-30 09:07:12
How much code documentation in your .NET source is too much? Some background: I inherited a large codebase that I've talked about in some of the other questions I've posted here on SO. One of the "features" of this codebase is a God Class, a single static class with >3000 lines of code encompassing several dozen static methods. It's everything from Utilities.CalculateFYBasedOnMonth() to Utilities.GetSharePointUserInfo() to Utilities.IsUserIE6() . It's all good code that doesn't need to be rewritten , just refactored into an appropriate set of libraries. I have that planned out. Since these

Using C#'s XML comment cref attribute with params syntax

99封情书 提交于 2019-11-30 00:28:07
In C#, I am trying to use <see cref="blah"/> to reference a method signature that contains the params keyword. I know this converts the parameter list to an array, but I can't even figure out how to refer to an array in a CREF attribute. I am finding nothing in my searches and no one I know has any idea, either. The compiler is choking on the square brackets. I've tried all kinds of different combinations, using curly braces, using the Array class, but nothing is working. Does anyone know this? jonp The ECMA 334 Standard PDF, Annex E contains a decent overview of XML Documentation comments.

Can ConfigurationManager retain XML comments on Save()?

纵然是瞬间 提交于 2019-11-28 21:11:42
I've written a small utility that allows me to change a simple AppSetting for another application's App.config file, and then save the changes: //save a backup copy first. var cfg = ConfigurationManager.OpenExeConfiguration(pathToExeFile); cfg.SaveAs(cfg.FilePath + "." + DateTime.Now.ToFileTime() + ".bak"); //reopen the original config again and update it. cfg = ConfigurationManager.OpenExeConfiguration(pathToExeFile); var setting = cfg.AppSettings.Settings[keyName]; setting.Value = newValue; //save the changed configuration. cfg.Save(ConfigurationSaveMode.Full); This works well, except for

How to have comments in IntelliSense for function in Visual Studio?

我怕爱的太早我们不能终老 提交于 2019-11-28 03:30:43
In Visual Studio and C#, when using a built in function such as ToString(), IntelliSense shows a yellow box explaining what it does. How can I have that for functions and properties I write? Solmead To generate an area where you can specify a description for the function and each parameter for the function, type the following on the line before your function and hit Enter : C#: /// VB: ''' See Recommended Tags for Documentation Comments (C# Programming Guide) for more info on the structured content you can include in these comments. Tomas Aschan What you need is xml comments - basically, they

XML multiline comments in C# - what am I doing wrong?

别说谁变了你拦得住时间么 提交于 2019-11-27 23:27:32
According to this article , it's possible to get multiline XML comments -- instead of using /// , use /** */ . This is my interpretation of what multiline comments are, and what I want to have happen: /** * <summary> * this comment is on line 1 in the tooltip * this comment is on line 2 in the tooltip * </summary> */ However, when I use this form, the tooltip that pops up when I hover over my class name in my code is single-line, i.e. it looks exactly as if I had written my comment like this: /// <summary> /// this comment is on line 1 in the tooltip /// this comment is on line 2 in the

Visual Studio Disabling Missing XML Comment Warning

做~自己de王妃 提交于 2019-11-27 17:07:11
I have a project with over 500 Missing XML Comment warnings. I know I can remove the XML Comment feature, or paste empty comment snippets everywhere, but I'd prefer a generic solution where I can make one change that disables all warnings of this type. What I do just now is putting ///<Summary> /// ///</Summary> or #pragma warning disable 1591 was just curious if it would be possible. Gorgsenegger As suggested above, in general I don't think that these warnings should be ignored (suppressed). To summarise, the ways around the warning would be to: Suppress the warning by changing the project

Can ConfigurationManager retain XML comments on Save()?

允我心安 提交于 2019-11-27 13:46:08
问题 I've written a small utility that allows me to change a simple AppSetting for another application's App.config file, and then save the changes: //save a backup copy first. var cfg = ConfigurationManager.OpenExeConfiguration(pathToExeFile); cfg.SaveAs(cfg.FilePath + "." + DateTime.Now.ToFileTime() + ".bak"); //reopen the original config again and update it. cfg = ConfigurationManager.OpenExeConfiguration(pathToExeFile); var setting = cfg.AppSettings.Settings[keyName]; setting.Value = newValue;

Change default XML comment snippet in Visual Studio

北城以北 提交于 2019-11-27 13:33:49
When I hit /// in Visual Studio, is it possible to change the resulting snippet from this: /// <summary> /// /// </summary> to this?: /// <summary></summary> Here is the solution working in at least VS2010. Save the bottom code as a file summ.snippet. Visual Studio 2010 / Tools / Code Snippet Manager Click import, browse to file. Save with default options. Now goto your code window and type summ + tab + tab Result /// <summary> </summary> with the cursor in the middle of the tag, ready to type. Here is the contents of the summ.snippet <CodeSnippets xmlns="http://schemas.microsoft.com

XML Comments not appearing in WCF Service

眉间皱痕 提交于 2019-11-27 06:20:05
问题 I have a WCF service and commenting my operation contracts as below: /// <summary> /// Call to topup a card. /// </summary> /// <param name="topUp">The TopUp object which specifies the card to topup.</param> /// <returns>Returns a boolean indicating whether call has finished successfully. </returns> [OperationContract] bool UploadTopUp(TopUp topUp); However the XML comments I am putting in the 3 forward slashes as above /// do not appear in the tooltips in my client application that consumes