Beispiel #1
0
 /// <summary>Creates a new instance of Server </summary>
 public NuGenHL7Service(NuGenParser parser, LowerLayerProtocol llp)
 {
     connections = System.Collections.ArrayList.Synchronized(new System.Collections.ArrayList(10));
     listeners   = new System.Collections.ArrayList();
     this.parser = parser;
     this.llp    = llp;
     this.router = new NuGenMessageTypeRouter();
 }
Beispiel #2
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;
            }
        }
Beispiel #3
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();
        }
		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;				
			}
		}
		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();
		}