documentation - Ways to synchronize interface and implementation comments in C# -


What are the free methods to sync comments between the interface and its implementation? I am currently documenting both of them and do not want to keep them in sync manually.

Update:

Consider this code:

  IFoo interface  

When I create a class like this:

  IFoo foo = new Foo (); Foo.DoThis (); // Comments are shown in intellisense  

The comments are not shown here:

  Foo foo = new Foo (); Foo.DoThis (); // Comments intellisense  

is not shown in & lt; InheritDoc / & gt; The tag will generate a complete document in Sand Castle, but

thanks.

itemprop = "text">

You can use Microsoft Sandcastle (or NDoc) inheritcode Using tags, this can be done very easily. It is not officially supported by the specification, but custom tags are fully acceptable, and in fact Microsoft chose to copy it (and one or two other tags) to NDOK when they made the redcast.

  /// & LT; Inheritdoc / & gt; /// & lt; Comment & gt; /// You can still specify all normal XML tags, and they are inherited according to ///. /// & lt; / Comment & gt; Public Null Method ImplementingInterfaceMethod (String Fu, Int Bar) {//}  

The Sandcastle Help File Builder is a help page from GUI, which describes its usage thoroughly.

(Of course, this is not particularly "synchronization", as your question is mentioned, but it appears that whatever you are searching for.)

As a note, it seems to be a completely neutral idea for me, although I have noticed that some people think that you should always represent comments in derivative and implemented classes. (I have actually done this in documenting one of my libraries and I am not seeing any problem.) There is almost always no reason to be totally different for comments, so it is not just the heir and it is not Why is not the easy way?

Edit: Regarding your update, Sandcastle can also take care of it for you Sandcastle can use a modified version of the actual XML file for input, whose This means that you can distribute this modified version with your library DLL instead of one directly produced by Visual Studio, which means that with the comment in Intellisense, the documentation file (CHM, whatever Have ).


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -