static public Showroom GetShowroom() { if (showroom == null) { showroom = new Showroom(); } return(showroom); }
public void Load() { using (Stream stream = File.OpenRead(filePath)) { var serializer = new BinaryFormatter(); Showroom st = (Showroom)serializer.Deserialize(stream); Copy(st.Clients, showroom.Clients); Copy(st.Cars, showroom.Cars); Copy(st.Orders, showroom.Orders); //Copy(st.Supplies, store.Supplies); } void Copy <T>(List <T> from, List <T> to) { to.Clear(); to.AddRange(from); } }
public DAO(Showroom showroom) { this.showroom = showroom; }