Ejemplo n.º 1
0
        private void btnAbstractFactory_Click(object sender, EventArgs e)
        {
            txtResult.Text = "ABSTRACT FACTORY Pattern" + Environment.NewLine;

            IFactory factory = new Factory1();

            txtResult.Text += "Factory 1:" + Environment.NewLine;
            txtResult.Text += factory.getCar().getMerke() + Environment.NewLine;
            txtResult.Text += factory.getBike().getSize().ToString() + Environment.NewLine;
            txtResult.Text += Environment.NewLine;

            txtResult.Text += "Factory 2:" + Environment.NewLine;
            factory         = new Factory2();
            txtResult.Text += factory.getCar().getMerke() + Environment.NewLine;
            txtResult.Text += factory.getBike().getSize().ToString() + Environment.NewLine;
        }