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)); } }
private void ValueDisplayer_TypeInspected(NuGenValueDisplayer sender, NuGenTypeDefinition typeDefinition) { InvokeDisplayEvaluationState(string.Format("Type inspected: {0} (assembly name: {1})", typeDefinition.FullName, typeDefinition.ModuleScope.Assembly.FileName), 1); UpdateCancelEvaluation(sender); if (!IsTypeOfValueFound) { IsTypeOfValueFound = true; NuGenStringValueFormatter objectTypeValueFormatter = new NuGenStringValueFormatter(typeDefinition.FullName); objectTypeValueFormatter.FieldGroup = ValueFieldGroup.ObjectInformation; objectTypeValueFormatter.Name = "Type of value"; InvokeDisplayValueFormatter(objectTypeValueFormatter, sender.ParentNode); } }
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); } }
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); } }
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)); } }