コード例 #1
0
        static void TemplateMethod()
        {
            var doctor   = new Medic(new RCPTypeB());
            var passerby = new Passerby();

            doctor.TreatingHeartAttack(passerby);
        }
コード例 #2
0
        static void Adapter()
        {
            var doctor          = new Medic(new RCPTypeA());
            var foreignPasserby = new ForeignPasserby(pc: 0.20, pb: 0.30, phr: 0.50);
            var passerby        = new ForeignPasserbyAdapter(foreignPasserby);

            doctor.TreatingHeartAttack(passerby);
        }