/// <summary> /// Default constructor - sets the version number and creates empty objects for deep properties. /// </summary> public TimetableDocument() { Version = 2; TrainClassList = new TrainClassCollection(); TrainClassList.TrainClassAdd += TrainClassChangedHandler; TrainClassList.TrainClassRemove -= TrainClassChangedHandler; TrainList = new TrainCollection(); TrainList.TrainAdd += TrainAddHandler; TrainList.TrainRemove += TrainRemoveHandler; LocationList = new LocationCollection(); LocationList.LocationAdd += LocationChangedHandler; LocationList.LocationRemove += LocationChangedHandler; DownTrainsDisplay = new TimetableSectionModel(Direction.Down, LocationList); UpTrainsDisplay = new TimetableSectionModel(Direction.Up, LocationList); Signalboxes = new SignalboxCollection(); Signalboxes.SignalboxAdd += SignalboxChangedHandler; Signalboxes.SignalboxRemove += SignalboxChangedHandler; SignalboxHoursSets = new SignalboxHoursSetCollection(); SignalboxHoursSets.SignalboxHoursSetAdd += SignalboxHoursSetChangedHandler; SignalboxHoursSets.SignalboxHoursSetRemove += SignalboxHoursSetChangedHandler; Options = new DocumentOptions(); NoteDefinitions = new NoteCollection(); NoteDefinitions.NoteAdd += NoteChangedHandler; NoteDefinitions.NoteRemove += NoteChangedHandler; ExportOptions = new DocumentExportOptions(); }
public void Setup() { trainList = new TrainCollection(); trainList.AddTrain(new Train("Sunny Valley", 1, new DateTime(2018, 2, 3, 9, 30, 00), 0, 10, 13, 1)); trainList.AddTrain(new Train("BSU", 2, new DateTime(2018, 7, 21, 11, 15, 00), 0, 1, 0, 15)); trainList.AddTrain(new Train("RAM", 3, new DateTime(2018, 9, 20, 18, 30, 00), 12, 8, 0, 0)); trainList.AddTrain(new Train("BSU", 4, new DateTime(2018, 1, 7, 10, 00, 00), 9, 1, 3, 1)); trainList.AddTrain(new Train("Sunny Valley", 5, new DateTime(2018, 4, 20, 8, 20, 00), 9, 8, 0, 1)); }
/// <summary> /// Constructor. /// </summary> /// <param name="locations">The locations to appear on the Y-axis of the graph.</param> /// <param name="trains">The trains to appear on the graph.</param> public TrainGraphModel(LocationCollection locations, TrainCollection trains) { LocationList = locations; TrainList = trains; if (TrainList != null) { TrainList.TrainAdd += TrainListChangeHandler; TrainList.TrainRemove += TrainListChangeHandler; } }