//deserialization constructor. public aShow(SerializationInfo info, StreamingContext ctxt) { //grab data from the serialization and assign it to local vars HtNights2Night = (Hashtable)info.GetValue("NightsHashtable", typeof(Hashtable)); ShowName = (string)info.GetValue("Name", typeof(string)); //initialize seat numbers seatNums = new SeatNumbers(); }
//default constructor public aShow(int nights, string name) { //set the show's name this.ShowName = name; //initialize seat numbers seatNums = new SeatNumbers(); //initialize hashtable HtNights2Night = new Hashtable(nights); for (int i = 1; i <= nights; i++) { //create a night object for each desired night Night night = new Night(); night.night = i; //and add it to the hashtable HtNights2Night.Add(i, night); }//end for }