Ejemplo n.º 1
0
 public void ajouterLireVariable(LectureVariable lectureVariable, int index)
 {
     this.ajouterInstruction(lectureVariable, index);
 }
Ejemplo n.º 2
0
 public void ajouterLireVariable(LectureVariable lectureVariable)
 {
     this.algorithme.ajouterInstruction(lectureVariable, this.listBox2.SelectedIndex);
     this.remplirListBoxAlgorithme();
 }
Ejemplo n.º 3
0
        private void traiteLectureVariable(LectureVariable lectureVariable)
        {
            Variable variableAAffecter = this.rechercheLaVariableDeNom(lectureVariable.obtenirNomVariable());
            if (variableAAffecter == null)
            {
                this.GUI.avertirNomDeVariableInexistant(lectureVariable.obtenirNomVariable());
                this.backgroundWorker.CancelAsync();
                return;
            }


            String expressionAEvaluer;
            while (true)
            {
                try
                {
                    this.GUI.afficheFenetreLireVariable(lectureVariable.obtenirNomVariable());
                    expressionAEvaluer = this.GUI.obtenirValeurLireVariable();
                    this.remplaceValeurDesVariables(ref expressionAEvaluer);
                    double resultatExpression = Convert.ToDouble(new Expression(expressionAEvaluer).Evaluate());
                    variableAAffecter.changerValeur(resultatExpression);
                    return;
                }
                catch (Exception e)
                {
                    continue;
                }
            }


        }