code_junkie

Code documentation: How much is too much?

Nov 12th, 2011
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.78 KB | None | 0 0
  1. /// <summary>
  2. /// Adds a new %Customer:CustomersLibrary.Customer% to the collection.
  3. /// </summary>
  4. /// <returns>A new Customer instance that represents the new customer.</returns>
  5. /// <example>
  6. /// The following example demonstrates adding a new customer to the customers
  7. /// collection.
  8. /// <code lang="CS" title="Example">
  9. /// CustomersLibrary.Customer newCustomer = myCustomers.Add(CustomersLibrary.Title.Mr, "John", "J", "Smith");
  10. /// </code>
  11. /// <code lang="VB" title="Example">
  12. /// Dim newCustomer As CustomersLibrary.Customer = myCustomers.Add(CustomersLibrary.Title.Mr, "John", "J", "Smith")
  13. /// </code>
  14. /// </example>
  15. /// <seealso cref="Remove">Remove Method</seealso>
  16. /// <param name="Title">The customers title.</param>
  17. /// <param name="FirstName">The customers first name.</param>
  18. /// <param name="MiddleInitial">The customers middle initial.</param>
  19. /// <param name="LastName">The customers last name.</param>
  20. public Customer Add(Title Title, string FirstName, string MiddleInitial, string LastName)
  21. {
  22. // create new customer instance
  23. Customer newCust = new Customer(Title, FirstName, MiddleInitial, LastName);
  24.  
  25. // add to internal collection
  26. mItems.Add(newCust);
  27.  
  28. // return ref to new customer instance
  29. return newCust;
  30. }
  31.  
  32. /// <summary>
  33. /// Returns the number of %Customer:CustomersLibrary.Customer% instances in the collection.
  34. /// </summary>
  35. /// <value>
  36. /// An Int value that specifies the number of Customer instances within the
  37. /// collection.
  38. /// </value>
  39. public int Count
  40. {
  41. get
  42. {
  43. return mItems.Count;
  44. }
  45. }
  46.  
  47. /// <include file="Documentation/XML/YourClass.xml" path="//documentation/members[@name='YourClass']/*"/>
Add Comment
Please, Sign In to add comment