Пример #1
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;
            }
        }
Пример #2
0
        private void evaluateButton_Click(object sender, EventArgs e)
        {
            DisplayExpressionText(expressionComboBox.Text);
            ClearEvaluationResults();

            try
            {
                NuGenParser parser = new NuGenParser();
                List <NuGenBaseExpression> expressions = parser.Parse(expressionComboBox.Text);

                if (expressions.Count > 0 && expressions[0] is NuGenMemberExpression)
                {
                    throw new NuGenParserException("The expression cannot start with a member expression (most likely an assembly is not in the project and therefore type information is not available).");
                }

                NuGenExpressionValueRefresher expressionRefresher = new NuGenExpressionValueRefresher(expressions, FrameRefresher, EvaluationContext.EvaluationHandler, expressionComboBox.Text);

                objectTree.Sorted = false;

                UpdateDisplayedValue    = false;
                objectTree.SelectedNode = RootNode;
                UpdateDisplayedValue    = true;

                NuGenIValueFormatter rootValueFormatter = new NuGenRootValueFormatter("Evaluated expression: " + expressionComboBox.Text);
                rootValueFormatter.ValueRefresher = expressionRefresher;
                rootValueFormatter.FieldNode      = RootNode;
                RootNode.Tag  = rootValueFormatter;
                RootNode.Text = rootValueFormatter.Name;

                DisplayValue(expressionRefresher, RootNode);

                fieldList.Sort();
                objectTree.Sorted = true;
            }
            catch (NuGenParserException parserException)
            {
                DisplayValueFormatter(new NuGenErrorValueFormatter("Parser exception", parserException.Message));
            }
            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));
            }

            expressionComboBox.Focus();
        }
Пример #3
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;				
			}
		}
Пример #4
0
		private void evaluateButton_Click(object sender, EventArgs e)
		{
			DisplayExpressionText(expressionComboBox.Text);
			ClearEvaluationResults();

			try
			{
				NuGenParser parser = new NuGenParser();
				List<NuGenBaseExpression> expressions = parser.Parse(expressionComboBox.Text);

				if (expressions.Count > 0 && expressions[0] is NuGenMemberExpression)
				{
					throw new NuGenParserException("The expression cannot start with a member expression (most likely an assembly is not in the project and therefore type information is not available).");
				}

				NuGenExpressionValueRefresher expressionRefresher = new NuGenExpressionValueRefresher(expressions, FrameRefresher, EvaluationContext.EvaluationHandler, expressionComboBox.Text);

				objectTree.Sorted = false;

				UpdateDisplayedValue = false;
				objectTree.SelectedNode = RootNode;
				UpdateDisplayedValue = true;

				NuGenIValueFormatter rootValueFormatter = new NuGenRootValueFormatter("Evaluated expression: " + expressionComboBox.Text);
				rootValueFormatter.ValueRefresher = expressionRefresher;
				rootValueFormatter.FieldNode = RootNode;
				RootNode.Tag = rootValueFormatter;
				RootNode.Text = rootValueFormatter.Name;

				DisplayValue(expressionRefresher, RootNode);

				fieldList.Sort();
				objectTree.Sorted = true;
			}
			catch (NuGenParserException parserException)
			{
				DisplayValueFormatter(new NuGenErrorValueFormatter("Parser exception", parserException.Message));
			}
			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));
			}

			expressionComboBox.Focus();
		}