.NET[2.0] How to add comments to my own classes in my DLLS?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dsuraj
    New Member
    • Apr 2008
    • 1

    .NET[2.0] How to add comments to my own classes in my DLLS?

    Hi all,
    How can I add comments to my own classes in my DLLS?
    e.g
    When you are coding and use one of microsofts functions/properties in one of the .net framework classes, each param of the function has a comment tooltip in intellisense that describes it, but when you make your own class, there is no such place to do something like this.

    So how to implement this in c#.net 2.0 ? please give me solution.
    Thanks in advance.

    Suraj
  • balame2004
    New Member
    • Mar 2008
    • 142

    #2
    Originally posted by dsuraj
    Hi all,
    How can I add comments to my own classes in my DLLS?
    e.g
    When you are coding and use one of microsofts functions/properties in one of the .net framework classes, each param of the function has a comment tooltip in intellisense that describes it, but when you make your own class, there is no such place to do something like this.

    So how to implement this in c#.net 2.0 ? please give me solution.
    Thanks in advance.

    Suraj

    Hi Suraj,

    You can use Summary tag to describe your classes/class members.

    Eg:

    Code:
    
    /// <summary>
    	/// Summary description for Class1.
    	/// </summary>
    	public class Man
    	{
    		/// <summary>
    		/// private variable name.
    		/// </summary>
    		private string name;
    
    		/// <summary>
    		/// private variable age
    		/// </summary>
    		private int age;
    
    		/// <summary>
    		/// 
    		/// </summary>
    		public Man()
    		{
    			//
    			// TODO: Add constructor logic here
    			//
    		}
    
    		/// <summary>
    		/// Name of a man.
    		/// </summary>
    		public string Name 
    		{
    		    get
    		    {
    			  return this.name;
    	        }
    			set
    			{
    				this.name=value;
    			}
    	    }
    
    
    		/// <summary>
    		/// Sets age of a man.
    		/// </summary>
    		/// <param name="age">Age - Number</param>
    		public void SetAge(int age)
    		{
    			this.age=age;
    		}
    	}

    Cheers,
    Balaji U

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      If you start out on the line ABOVE the item you want to comment, and hit the "/" three times, it should attempt to auto-generate a template for adding comments to the object.

      For instance if I have this:
      Code:
      protected ArrayList SearchIT(string query)
      And I hit "/" three times on the line above it, I get:
      Code:
      /// <summary>
      /// 
      /// </summary>
      /// <param name="query"></param>
      /// <returns></returns>
      protected ArrayList SearchIT(string query)

      Comment

      Working...