Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the filterpriority tag in an XML comment do?

I have seen this in a lot of XML comments for classes in the .NET Framework BCL but have never been able to find documentation that explains what it does.

As an example, looking at System.Object reveals the following comments:

namespace System    {     /// <summary>Supports all classes in the .NET Framework class hierarchy      /// and provides low-level services to derived classes. This is the      /// ultimate base class of all classes in the .NET Framework; it is the     /// root of the type hierarchy.</summary>     /// <filterpriority>1</filterpriority>      [System.Runtime.InteropServices.ClassInterfaceAttribute(2)]     public class Object         {             /// <summary>Determines whether the specified          /// <see cref="T:System.Object" />          /// instances are considered equal.</summary>           /// <returns>true if objA is the same instance as objB or         /// if both are null         /// references or if objA.Equals(objB) returns true;          /// otherwise, false.</returns>         /// <param name="objB">The second <see cref="T:System.Object" />          /// to compare. </param>         /// <param name="objA">The first <see cref="T:System.Object" />          /// to compare. </param>         /// <filterpriority>2</filterpriority>         public static bool Equals(object objA, object objB);      }  } 
like image 684
Scott Dorman Avatar asked Nov 11 '08 16:11

Scott Dorman


People also ask

What are XML comments?

XML comments are similar to HTML comments. The comments are added as notes or lines for understanding the purpose of an XML code. Comments can be used to include related links, information, and terms. They are visible only in the source code; not in the XML code. Comments may appear anywhere in XML code.

What are XML comments in C#?

C# documentation comments use XML elements to define the structure of the output documentation. One consequence of this feature is that you can add any valid XML in your documentation comments. The C# compiler copies these elements into the output XML file.


2 Answers

Just a guess: the All vs Common tabs in intellisense?

like image 121
Joel Coehoorn Avatar answered Sep 25 '22 01:09

Joel Coehoorn


It is the same as decorating your member with EditorBrowsableAttribute. I would guess values 0,1 and 2 corresponds to Always, Advanced and Never.

like image 41
Øyvind Skaar Avatar answered Sep 25 '22 01:09

Øyvind Skaar