static void Main(string[] args) { Person xc = new Person("小菜"); Console.WriteLine("\n第一種裝扮:"); Finery dtx = new TShirts(); Finery kk = new BigTrouser(); Finery pqx = new Sneakers(); dtx.Show(); kk.Show(); pqx.Show(); xc.Show(); Console.WriteLine("\n第二種裝扮:"); Finery xz = new Suit(); Finery ld = new Tie(); Finery px = new LeatherShoes(); xz.Show(); ld.Show(); px.Show(); xc.Show(); Console.Read(); }
public override void Show() { if (component != null) { component.Show(); } }
static void Main(string[] args) { Person xc = new Person("小菜"); Console.WriteLine("\n第一種裝扮:"); xc.WearTShirts(); xc.WearBigTrouser(); xc.WearSneakers(); xc.Show(); Console.WriteLine("\n第二種裝扮:"); xc.WearSuit(); xc.WearTie(); xc.WearLeatherShoes(); xc.Show(); Console.Read(); }