comment a structure

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sharon

    comment a structure

    Hi all

    I have this structure ,

    public struct struct_name{

    public int len;

    public bool tmp;

    }



    What is the right way to comment this structure?

    Every way I try I get this warning:



    Missing xml comment for publicly visible type or member ...



    Thank you

    Sharon


  • Bruce Wood

    #2
    Re: comment a structure

    /// <summary>This is what struct_name is for...</summary>
    public struct struct_name{
    /// <summary>This is what 'len' means.</summary>
    public int len;
    /// <summary>This is what 'tmp' means.</summary>
    public bool tmp;
    }

    Comment

    • Jon Skeet [C# MVP]

      #3
      Re: comment a structure

      Sharon <Sharon669@hotm ail.com> wrote:[color=blue]
      > Hi all
      >
      > I have this structure ,
      >
      > public struct struct_name{
      >
      > public int len;
      >
      > public bool tmp;
      >
      > }
      >
      >
      >
      > What is the right way to comment this structure?
      >
      > Every way I try I get this warning:
      >
      >
      >
      > Missing xml comment for publicly visible type or member ...[/color]

      Put an XML comment before the struct itself and each of the members:


      /// <summary>
      /// ...
      /// </summary>
      public struct struct_name{

      /// <summary>
      /// ...
      /// </summary>
      public int len;

      /// <summary>
      /// ...
      /// </summary>
      public bool tmp;
      }

      --
      Jon Skeet - <skeet@pobox.co m>
      Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

      If replying to the group, please do not mail me too

      Comment

      Working...