Ejemplo n.º 1
0
        private void StopEvaluation()
        {
            if (ValueDisplayer.IsEvaluationRunning)
            {
                ValueDisplayer.InterruptEvaluation();
            }

            CancelValueFormattersDisplaying = true;
        }
Ejemplo n.º 2
0
        private void closeButton_Click(object sender, EventArgs e)
        {
            if (ValueDisplayer != null && ValueDisplayer.IsEvaluationRunning)
            {
                CancelValueFormattersDisplaying = true;
                ValueDisplayer.InterruptEvaluation();
            }

            evaluationLogListBox.Items.Clear();
            Close();
        }
Ejemplo n.º 3
0
        private void DisplayValue(NuGenBaseValueRefresher valueRefresher, TreeNode parentNode)
        {
            fieldList.Items.Clear();
            evaluationLogListBox.Items.Clear();

            try
            {
                NuGenDebugExpressionResult debugValue = new NuGenDebugExpressionResult(EvaluationContext, valueRefresher.GetRefreshedValue());

                if (NuGenHelperFunctions.HasValueClass(debugValue.ResultValue))
                {
                    EnableControlsForEvaluation(false);
                    CancelValueFormattersDisplaying = false;
                    MissingModules     = new List <NuGenIValueFormatter>();
                    IsTypeOfValueFound = false;
                    ValueDisplayer.CreateComplexFormatter(debugValue, valueRefresher, FrameRefresher, parentNode);
                }
                else
                {
                    NuGenIValueFormatter valueFormatter = ValueDisplayer.CreateSimpleFormatter(debugValue);
                    valueFormatter.Name           = valueRefresher.Name;
                    valueFormatter.ValueRefresher = valueRefresher;
                    DisplayValueFormatter(valueFormatter);

                    if (valueFormatter is NuGenISimpleTypeValueFormatter)
                    {
                        NuGenStringValueFormatter valueTypeFormatter = new NuGenStringValueFormatter(((NuGenISimpleTypeValueFormatter)valueFormatter).GetNumberTypeName());
                        valueTypeFormatter.FieldGroup = ValueFieldGroup.ObjectInformation;
                        valueTypeFormatter.Name       = "Type of value";
                        DisplayValueFormatter(valueTypeFormatter);
                    }
                }
            }
            catch (NuGenEvaluationException evaluationException)
            {
                DisplayValueFormatter(new NuGenErrorValueFormatter("Evaluation exception", evaluationException.Message));
            }
            catch (NuGenEvaluationHandlerException evaluationHandlerException)
            {
                DisplayValueFormatter(new NuGenErrorValueFormatter("Evaluation running exception", evaluationHandlerException.Message));
            }
            catch (NugenMissingModuleException missingModuleException)
            {
                DisplayValueFormatter(new NuGenMissingModuleFormatter(missingModuleException.MissingModule));
            }
            catch (InvalidOperationException invalidOperationException)
            {
                DisplayValueFormatter(new NuGenErrorValueFormatter("Evaluation exception", invalidOperationException.Message));
            }
            catch (Exception exception)
            {
                DisplayValueFormatter(new NuGenErrorValueFormatter("Unexpected exception", exception.Message));
            }
        }
Ejemplo n.º 4
0
        private void DisplayWatchExpression(GridEXRow watchRow)
        {
            NuGenIValueFormatter          watchValueFormatter = null;
            NuGenExpressionValueRefresher expressionRefresher = null;

            try
            {
                NuGenParser parser                     = new NuGenParser();
                string      watchExpression            = (string)watchRow.Cells[0].Value;
                List <NuGenBaseExpression> expressions = parser.Parse(watchExpression);
                expressionRefresher = new NuGenExpressionValueRefresher(expressions, ActiveFrameRefresher, EvaluationContext.EvaluationHandler, watchExpression);

                watchValueFormatter = ValueDisplayer.CreateSimpleFormatter(expressionRefresher.GetRefreshedValue());
            }
            catch (NuGenParserException parserException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Parser exception", parserException.Message);
            }
            catch (NuGenEvaluationException evaluationException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Evaluation exception", evaluationException.Message);
            }
            catch (NuGenEvaluationHandlerException evaluationHandlerException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Evaluation running exception", evaluationHandlerException.Message);
            }
            catch (NugenMissingModuleException missingModuleException)
            {
                watchValueFormatter = new NuGenMissingModuleFormatter(missingModuleException.MissingModule);
            }
            catch (InvalidOperationException invalidOperationException)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Evaluation exception", invalidOperationException.Message);
            }
            catch (Exception exception)
            {
                watchValueFormatter = new NuGenErrorValueFormatter("Unexpected exception", exception.Message);
            }

            if (watchValueFormatter != null)
            {
                watchValueFormatter.ValueRefresher = expressionRefresher;
                watchRow.Cells[1].Value            = watchValueFormatter.GetFormattedString(NuGenSettings.Instance.DisplayHexaNumbers);
                NuGenHelperFunctions.TaggedObjects[(int)watchRow.Cells[2].Value] = watchValueFormatter;
            }
        }
Ejemplo n.º 5
0
        private void ShowObjects(List <NuGenBaseValueRefresher> objects)
        {
            for (int index = 0; index < objects.Count; index++)
            {
                NuGenBaseValueRefresher valueRefresher = objects[index];
                NuGenIValueFormatter    valueFormatter = null;

                try
                {
                    NuGenDebugExpressionResult debugValue = new NuGenDebugExpressionResult(evaluationContext, valueRefresher.GetRefreshedValue());
                    valueFormatter = ValueDisplayer.CreateSimpleFormatter(debugValue);
                }
                catch (Exception exception)
                {
                    valueFormatter = new NuGenStringValueFormatter(exception.ToString());
                }

                valueFormatter.Name           = valueRefresher.Name;
                valueFormatter.ValueRefresher = valueRefresher;

                AddValueFormatter(valueFormatter);
            }
        }