Object Oriented Programming using C#

(backadmin) #1

Object Oriented Programming using C#
Case Study


Three of the comments taken from the Client class are shown below :-


/// <summary>
/// Manages a collection (sorted dictionary) of clients where each
/// client has an ID number (int).
/// </summary>
/// <remarks>Author Simon Kendal
/// Version 1.0 (5th May 2011)</remarks>
public class ClientBook
{
private SortedDictionary<int, Client> clients;
/// <summary>
/// Gets the clients.
/// </summary>
public SortedDictionary<int, Client> Clients
{
// ... lines missing ...
}
/// <summary>
/// Initializes a new empty instance of the <see
cref=”ClientBook”/> class.
/// </summary>
public ClientBook()
{
// ... lines missing ...
}
/// <summary>
/// Initializes a new instance of the <see cref=”ClientBook”/>
class and instantiates this to the disctionary passed.
/// </summary>
/// <param name=”clients”>A disctionary of Client ID, Client
objects.</param>
public ClientBook(SortedDictionary<int, Client> clients)
{
// ... code omitted ...
}
/// <summary>
/// Adds a client to the client book
/// </summary>
/// <param name=”clientID”>The client ID.</param>
/// <param name=”newClient”>The new client.</param>
/// <exception cref=”ClientAlreadyExistsException”> Throws
exception if a client with ClientID already exists</exception>
public void AddClient(int clientID, Client newClient)
{
// ... code omitted ...
}

Once XML comments have been placed throughout the code and exported, and comments have been added to the
Sandcastle Help File Builder tool to describe the namespaces then this tool can be used to generate a set of web pages to
describe the system.... virtually at the push of a button!

Free download pdf