Пример #1
0
        public CDType BuildSamsungCDType()
        {
            CDType cds = new CDType();

            cds.AddItem(new Samsung());
            return(cds);
        }
Пример #2
0
        public CDType BuildSonyCDType()
        {
            CDType cds = new CDType();

            cds.AddItem(new Sony());
            return(cds);
        }
Пример #3
0
        static void Main(string[] args)
        {
            CDBuilder cDBuilder = new CDBuilder();
            CDType    cdType    = cDBuilder.BuildSonyCDType();

            cdType.ShowItems();

            CDType cdType2 = cDBuilder.BuildSamsungCDType();

            cdType2.ShowItems();

            Console.ReadLine();
        }