Click here to Skip to main content
15,886,805 members
Articles / Programming Languages / C#

Using XML Documentation in your Code

Rate me:
Please Sign up or sign in to vote.
4.43/5 (11 votes)
29 Jun 2009CPOL5 min read 31.2K   124   23  
In this article, I will show you how to add documentation to your classes and methods to make good use of the IntelliSense feature and make your code more understandable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace XML_Documentation
{
    /// <summary>
    /// Contains fundamental calculations, constants and conversions
    /// </summary>
    class PhysicsLib
    {
        /// <summary>
        /// retrieves the distance covered with a defined initial velocity, final velocity and acceleration or time in motion
        /// </summary>
        public double getDistance(double U, double Acc, double timeInMotion)
        {
            return (U * timeInMotion + 0.5 * Acc * Math.Pow(timeInMotion, 2));
        }

        /// <summary>
        /// retrieves the distance covered with a defined initial velocity, final velocity and acceleration or time in motion
        /// </summary>
        /// <param name="U">the initial velocity</param>
        /// <param name="Acc">the acceleration of the body</param>
        /// <param name="V">the final velocity of the body</param>
       public double getDistance(double U,  double Acc, float V)
        {
            return ((V * V - U * U) / (2 * Acc));
        }

        public enum Constants
        {
            /// <summary>
            /// The speed of Light in a vaccum
            /// </summary>
            C0 = 299792458,
            /// <summary>
            /// the characteristic impedance
            /// </summary>
            Z0 = 377
        }

        public class Conversions
        {
            /// <summary>
            /// 
            /// </summary>
            /// <param name="Hp"> Converts Horsepower to Kilowatt</param>
            /// <returns></returns>
            public double HorsepowerToKiloWatt(double Hp)
            {
                return (Hp * 0.7457);
            }

            public double GallonsToLitres(double Gals)
            {
                return (Gals * 3.7854);
            }

        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
United Kingdom United Kingdom
I have deserted general software development and chosen to enter microprocessors and push around 1s and 0s

Comments and Discussions