예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            Pen p = new Pen(Color.Black);
            PersonThinBuilder ptb    = new PersonThinBuilder(pictureBox1.CreateGraphics(), p);
            PersonDirector    pbThin = new PersonDirector(ptb);

            pbThin.CreatePerson();

            PersonFatBuilder pfb   = new PersonFatBuilder(pictureBox2.CreateGraphics(), p);
            PersonDirector   pbFat = new PersonDirector(pfb);

            pbFat.CreatePerson();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            var thinBulider  = new PersonThinBuilder();
            var thinDirector = new PersonDirector(thinBulider);

            thinDirector.CreatePerson();

            var fatBulider  = new PersonFatBuilder();
            var fatDirector = new PersonDirector(fatBulider);

            fatDirector.CreatePerson();

            Console.Read();
        }
예제 #3
0
        private void btn_Draw(object sender, EventArgs e)
        {
            Pen p = new Pen(Color.Yellow);

            PersonThinBuilder ptb    = new PersonThinBuilder(pictureBox1.CreateGraphics(), p);
            PersonDirector    pdthin = new PersonDirector(ptb);

            pdthin.CreatePerson();

            PersonFatBuilder pfb   = new PersonFatBuilder(pictureBox2.CreateGraphics(), p);
            PersonDirector   pdFat = new PersonDirector(pfb);

            pdFat.CreatePerson();
        }