예제 #1
0
        private KruispuntForm loadKruispunt(IKruispunt load)
        {
            KruispuntForm kruispunt;

            if (load is Type1)
            {
                load = load as Type1;
                kruispunt = new TKP1(load);
            }
            else if (load is Type2)
            {
                load = load as Type2;
                kruispunt = new TKP2(load);
            }
            else if (load is Type3)
            {
                load = load as Type3;
                kruispunt = new TKP3(load);
            }
            else if (load is Type4)
            {
                load = load as Type4;
                kruispunt = new TKP4(load);
            }
            else
            {
                return null;
            }

            return kruispunt;
        }
예제 #2
0
        private KruispuntForm createKruispunt(ComboBox comboBox)
        {
            KruispuntForm kruispunt;

            if (comboBox.Text == "Type 1") {
                kruispunt = new TKP1(new Type1());
            } else if (comboBox.Text == "Type 2") {
                kruispunt = new TKP2(new Type2());
            } else if (comboBox.Text == "Type 3") {
                kruispunt = new TKP3(new Type3());
            } else if (comboBox.Text == "Type 4") {
                kruispunt = new TKP4(new Type4());
            } else {
                return null;
            }

            return kruispunt;
        }