Ejemplo n.º 1
0
        public override StackPanel InsertInUIParent(StackPanel parent)
        {
            parent.Children.Add(
                new Label()
            {
                Content = questionNode.Label.ToString()
            }
                );

            Value widgetValue;

            try
            {
                widgetValue = this.Evaluate();
            }
            catch (DivideByZeroException divByZero) //constructivist: rollback
            {
                widgetValue = symbolTable.GetValue(questionNode.Identifier);
            }

            ValueToUIElement valueToUIElement = new ValueToUIElement(questionNode.Identifier.Name, questionNode.Computation != null);

            valueToUIElement.EventUpdateValue += base.EventUpdateValue;

            parent.Children.Add(widgetValue.Accept(valueToUIElement));

            return(parent);
        }
Ejemplo n.º 2
0
        public override StackPanel InsertInUIParent(StackPanel parent)
        {
            parent.Children.Add(
                new Label() { Content = questionNode.Label.ToString() }
                );

            Value widgetValue;

            try
            {
                widgetValue = this.Evaluate();
            }
            catch (DivideByZeroException divByZero) //constructivist: rollback
            {
                widgetValue = symbolTable.GetValue(questionNode.Identifier);
            }

            ValueToUIElement valueToUIElement = new ValueToUIElement(questionNode.Identifier.Name, questionNode.Computation != null);
            valueToUIElement.EventUpdateValue += base.EventUpdateValue;

            parent.Children.Add(widgetValue.Accept(valueToUIElement));

            return parent;
        }