private static void NewMethod1() { Person pr = new Person("Leng"); Console.WriteLine("first look"); Finery tShirts = new TShirts(); tShirts.Show(); Finery bigTrouser = new BigTrouser(); bigTrouser.Show(); Finery sneakers = new Sneakers(); sneakers.Show(); pr.Show(); Console.WriteLine("\nsecond look"); Finery suit = new Suit(); suit.Show(); Finery tie = new Tie(); tie.Show(); Finery leatherShoes = new LeatherShoes(); leatherShoes.Show(); pr.Show(); Console.Read(); }
public override void Show() { if (component != null) { component.Show(); } }
public override void Show() { if (_compont != null) { _compont.Show(); } }
static void Main(string[] args) { Person p = new Person("小明"); p.Show(); Console.WriteLine(); TShirts ts = new TShirts(); ts.Decorate(p); ts.Show(); BigTrouser dt = new BigTrouser(); dt.Show(); Console.WriteLine(); dt.Decorate(p); dt.Show(); dt.Decorate(ts); dt.Show(); }
static void Main(string[] args) { Person p = new Person("小明"); p.Show(); Console.WriteLine(); TShirts ts = new TShirts(); ts.Decorate(p); ts.Show(); BigTrouser dt = new BigTrouser(); dt.Show(); Console.WriteLine(); dt.Decorate(p); dt.Show(); dt.Decorate(ts); dt.Show(); }
public override void Show() { Component?.Show(); }