private void Adapter_Button_Click(object sender, RoutedEventArgs e)
        {
            Student student = new Student();

            Pen pen = new Pen();

            AdapterTxtbl.Text += student.Stuf(pen) + '\n';
            AdapterTxtbl.Text += "Oops! Pen ended \n";

            Chalk chalk      = new Chalk();
            IPen  chalkStuff = new ChalkToPenAdapter(chalk);

            AdapterTxtbl.Text += student.Stuf(chalkStuff) + '\n';
        }
Beispiel #2
0
        private void Adapter_Button_Click(object sender, RoutedEventArgs e)
        {
            Student student = new Student();

            Pen pen = new Pen();

            AdapterTxtbl.Text += student.Stuf(pen) + '\n';
            AdapterTxtbl.Text += "Опп... В ручке стержень закончился \n";

            Chalk chalk      = new Chalk();
            IPen  chalkStuff = new ChalkToPenAdapter(chalk);

            AdapterTxtbl.Text += student.Stuf(chalkStuff) + '\n';
        }