static void Main(string[] args) { ITelefon Telefon1 = TelefonFactory.StworzObiektTelefon(Marki.Apple); ITelefon Telefon2 = TelefonFactory.StworzObiektTelefon(Marki.Samsung); Telefon1.stworzTelefon(); Telefon2.stworzTelefon(); Console.ReadKey(); }
static void Main(string[] args) { ITelefon tel1 = TelefonFactory.CreateTelefonObject(Marki.Apple); ITelefon tel2 = TelefonFactory.CreateTelefonObject(Marki.Samsung); tel1.zlozTelefon(); tel2.zlozTelefon(); Console.ReadKey(); }
public static ITelefon StworzObiektTelefon(Marki marki) { ITelefon telefon = null; switch (marki) { case Marki.Apple: telefon = new Apple(); break; case Marki.Samsung: telefon = new Samsung(); break; default: throw new ArgumentOutOfRangeException("marki", "Błędna marka."); } return(telefon); }
public static ITelefon CreateTelefonObject(Marki markaTyp) { ITelefon telefon = null; switch (markaTyp) { case Marki.Apple: telefon = new Apple(); break; case Marki.Samsung: telefon = new Samsung(); break; default: throw new ArgumentOutOfRangeException("markaTyp", "Nieznana marka telefonu."); } return(telefon); }
public Dekorator(ITelefon iTelefon, string typ) { this.iTelefon = iTelefon; this.typ = typ; }
public Dekorator(ITelefon itelefon) { _itelefon = itelefon; }
public Dekorator(ITelefon _itelefon, string _typ) { _Itelefon = _itelefon; _Typ = _typ; }
public Dekorator(string typtelefonu, ITelefon itelefon) { this._TypTelefonu = typtelefonu; this._ITelefon = itelefon; }