Call GetLength for two dimenional array

image_pdfimage_print

using System;

class ChessBoard {
static void Main(String[] args) {
Char[,] SquareColor = new Char[8, 8];
for (int i = 0; i < SquareColor.GetLength(0); i++) { for (int x = 0; x < SquareColor.GetLength(1); x++) { if ((x % 2) == 0) if ((i % 2) == 0) SquareColor[i, x] = 'W'; else SquareColor[i, x] = 'B'; else if ((i % 2) == 0) SquareColor[i, x] = 'B'; else SquareColor[i, x] = 'W'; } } for (int i = 0; i < SquareColor.GetLength(0); i++) { for (int x = 0; x < SquareColor.GetLength(1); x++) { Console.Write(SquareColor[i, x]); } Console.WriteLine(); } } } [/csharp]

value doc tag

image_pdfimage_print
   
 

// compile with: /doc:DocFileName.xml 

/// text for class Employee
public class Employee
{
    private string _name;

    /// <summary>The Name property represents the employee&#039;s name.</summary>
    /// <value>The Name property gets/sets the _name data member.</value>
    public string Name
    {
        get
        {
            return _name;
        }
        set
        {
            _name = value;
        }
    }
}

/// text for class MainClass
public class MainClass
{
    /// text for Main
    static void Main()
    {
    }
}

   
     


Summary doc tag, example doc tag

image_pdfimage_print
   
 


// compile with: /doc:DocFileName.xml 

/// text for class TestClass
public class TestClass
{
    /// <summary>
    /// The GetZero method.
    /// </summary>
    /// <example> This sample shows how to call the <see cref="TestClass.GetZero"/> method.
    /// <code>
    /// class TestClass 
    /// {
    ///     static int Main() 
    ///     {
    ///         return GetZero();
    ///     }
    /// }
    /// </code>
    /// </example>
    public static int GetZero()
    {
        return 0;
    }

    /// text for Main
    static void Main()
    {
    }
}

   
     


XML based comments

image_pdfimage_print
   
  
using System;

/// <summary>
/// Main method.
/// <para>This sample is useless.</para>
/// </summary>
class SayHello {
    /// <summary>
    /// This is the Main method for the class and is
    /// the execution starting point for our application.
    /// Please note that <paramref name="args">args</paramref>
    /// is a array of strings.
    /// </summary>
    /// <param name="args">params for Main method</param>
    /// <returns>Returns a value depending on how the program
    /// was called.</returns>
    //We want Main to return an integer.
    public static int Main(string[] args) {
        if (args.Length > 0) {
            return (0);
        }
        return (1);
    }
}