Visual C++ .NET/Development/Document

Материал из .Net Framework эксперт
Версия от 12:04, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

A bullet list

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// A bullet list
        /// <list type="bullet">
        ///   <item> bullet </item>
        ///   <item> bullet </item>
        /// </list>
        /// </summary>
        void listTag() {}
    }


A definition of terms

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// A definition of terms
        /// <list type="table">
        ///   <listheader>
        ///     <term>Properties</term>
        ///     <description>Initial Value</description>
        ///   </listheader>
        ///   <item>
        ///     <term>term1 name</term>
        ///     <description>term1 description</description>
        ///   </item>
        ///   <item>
        ///     <term>term2 name</term>
        ///     <description>term2 description</description>
        ///   </item>
        ///   <item>
        ///     <term>termN name</term>
        ///     <description>termN description</description>
        ///   </item>
        /// </list>
        /// </summary>
        void listTag() {}
    }


A numbered list

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// A numbered list
        /// <list type="number">
        ///   <item> entry 1 </item>
        ///   <item> entry 2 </item>
        ///   <item> entry n </item>
        /// </list>
        /// </summary>
        void listTag() {}
    }


A table

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// A table
        /// <list type="table">
        ///   <item>
        ///     <description>row 1 -- column a</description>
        ///     <description>row 1 -- column b</description>
        ///     <description>row 1 -- column c</description>
        ///   </item>
        ///   <item>
        ///     <description>row 2 -- column a</description>
        ///     <description>row 2 -- column b</description>
        ///     <description>row 2 -- column c</description>
        ///   </item>
        /// </list>
        /// </summary>
        void listTag() {}
    }


Example code tag

 
    public ref class AClass
    {
    public:
        /// <example>
        ///   <para> Example summary </para>
        ///   <code lang="vbnet"> 
        ///   Visual Basic .NET code example
        ///   </code>
    ///   <code lang="c#">
        ///   C# code example
        ///   </code>
        ///   <code lang="cpp">
        ///   C++ code example
        ///   </code>
        /// </example>
        void exampleTag() {}
    }


Include tag

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// <summary> This is a summary with an &lt;include&gt; tag containing 
        ///    a &lt;list type="bullet"&gt;
        ///    <include file="document.xml" path="AllDoc/Entry[@num="1"]/*" />
        /// </summary>
        /// <include file="document.xml" path="AllDoc/Entry[@num="2"]/*" />
        /// </summary>
        void includeTag() {}
    }


paramref tag

 
    public ref class AClass
    {
    public:
        /// <summary> This summary reference the <paramref name="param1"/> 
        /// parameter of the method
        /// </summary>
        void paramrefTag(int param1) {}
    }


Property value tag

 
    public ref class AClass
    {
    public:
        /// <value> valueTag property has a value of double</value>
        property double valueTag
        {
            double get() {return 0.0;}
            void set(double val) {}
        }
    }


Remark tag

 
    public ref class AClass
    {
    public:
        /// <remarks> 
        /// This is a remarks tag for the remarksTag() method 
        /// </remarks>
        void remarksTag() {}
    }


See also tag

 
    public ref class AClass
    {
    public:
        /// <summary>
        /// The basic see tag <see cref="File" />
        /// The enhanced see tag <see cref="FileInfo">System::IO:FileInfo</see>
        /// </summary>
        void seeTag() {}
    }


Summary Tag

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// This is a summary tag for the summaryTag() method 
        /// </summary>
        void summaryTag() {}
    }


Using code tag to insert code

 
    public ref class AClass
    {
    public:
        /// <example>
        /// Some code in an example tag
        /// <code lang="cpp"> 
        ///   A code statement;
        ///   Another code statement;
        /// </code>
        /// </example>
        void codeTag() {}
    }


Using c tag to insert code

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// Some <c>Program code</c> in a summary 
        /// </summary>
        void cTag() {}
    }


Using exception Tag to describe the exception

 
    public ref class AClass
    {
    public:
        /// <exception cref="System::OverflowException"> 
        /// This method might throw this exception (NOT)
        /// </exception> 
        void exceptionTag() {}
    }


Using paragraph tag to insert large chunk of comments

 
    public ref class AClass
    {
    public:
        /// <summary> 
        /// <para>This is the first paragraph which spans more than one line 
        /// when the document window is small enough.</para><para>This is the 
        /// next paragraph which started in a new line.</para>
        /// </summary>
        void paraTag() {}
    }


Using param tag to add comments for the parameters

 
    public ref class AClass
    {
    public:
        /// <param name="param1">The first int parameter</param>
        /// <param name="param2">The second String^ parameter</param>
        void paramTag(int param1, String ^param2) {}
    }


Using permission Tag to tell the permission

 
    public ref class AClass
    {
    public:
        /// <permission cref="System::Security::PermissionSet">
        ///   Go ahead anyone can access me.
        /// </permission>
        void permissionTag() {}
    }


Using return tag to add comments for returning value

 
    public ref class AClass
    {
    public:
        /// <returns> returnsTag returns an int </returns>
        int returnsTag() {return 0;}
    }