static void Main(string[] args) { Producent Acer = new Producent("Acer", "Jamajka", 1234); Producent Dell = new Producent("Dell", "Polska", 4321); Komputer k1 = new Komputer("Acer", 2000, Acer); Laptop p1 = new Laptop("Dell", 2500, Dell, "Super laptop", 1200); List <Komputer> komputery = new List <Komputer>(); komputery.Add(k1); komputery.Add(p1); DataSerializer ds = new DataSerializer(); ds.BinarySerialize(komputery, "komputery.dat"); List <Komputer> komputery1 = (List <Komputer>)ds.BinaryDeserialize("komputery.dat"); Console.WriteLine(); }
public Laptop(string marka, double cena, Producent producent, string opis, int waga) : base(marka, cena, producent) { this.opis = opis; this.waga = waga; }
public Komputer(string marka, double cena, Producent producent) { this.cena = cena; this.marka = marka; this.producent = producent; }