15.6. Changes to ScheduleOfClasses

Next, we'll retrofit the ScheduleOfClasses class that we developed in Chapter 14 with this same ability to "self-initialize" from an ASCII file. We'll add an additional data element to the class: a string that contains the name of the file that holds the SoC data. We'll implement this data element as an auto-implemented property.

using System;
using System.Collections.Generic;
using System.IO;

public class ScheduleOfClasses {

  //-------------------------------
  // Auto-implemented properties.
  //-------------------------------

  public string Semester { get; set; }
  public string ScheduleFile { get; set; } // This Dictionary stores Section object references using // a String concatenation of course no. and section ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.