示例#1
0
        private void Button_GO_Click(object sender, RoutedEventArgs e)
        {
            PatronDeConceptionFabriqueEtCommande.Trame.Trame trame = new PatronDeConceptionFabriqueEtCommande.Trame.Trame();

            if (RadioButton_Information.IsChecked.Value)
            {
                trame.TypeDeMessage = CommandeFactory.TypeMessageInfo;
            }
            if (RadioButton_Avertissement.IsChecked.Value)
            {
                trame.TypeDeMessage = CommandeFactory.TypeMessageAvertissement;
            }
            if (RadioButton_Fermer.IsChecked.Value)
            {
                trame.TypeDeMessage = CommandeFactory.TypeMessageFermerLeProgramme;
            }
            if (RadioButton_AfficherLesBovins.IsChecked.Value)
            {
                trame.TypeDeMessage = CommandeFactory.TypeMessageAfficherLesBovins;
            }
            trame.ChargeUtile = ExempleDeTrame.Text;

            Commande commande = CommandeFactory.GetCommande(trame);

            if (commande != null)
            {
                commande.Execute();
            }
        }