private void Trace(object aggregatedValue, PropertyDefinition aggregatedProperty, PropertyAggregationContext context) { if (PropertyAggregationStrategy.Tracer.IsTraceEnabled(TraceType.DebugTrace)) { StringBuilder stringBuilder = new StringBuilder(100); stringBuilder.Append("{"); bool flag = true; foreach (IStorePropertyBag storePropertyBag in context.Sources) { if (flag) { flag = false; } else { stringBuilder.Append(", "); } foreach (PropertyDependency propertyDependency in this.Dependencies) { object obj = storePropertyBag.TryGetProperty(propertyDependency.Property); if (obj != null) { PropertyError propertyError = obj as PropertyError; if (propertyError != null) { if (propertyError.PropertyErrorCode != PropertyErrorCode.NotFound) { stringBuilder.Append(PropertyAggregationStrategy.GetPropertyValuePair(propertyDependency.Property, "ERROR:" + propertyError.PropertyErrorCode.ToString())); } } else { stringBuilder.Append(PropertyAggregationStrategy.GetPropertyValuePair(propertyDependency.Property, obj)); } } } } stringBuilder.Append("}"); PropertyAggregationStrategy.Tracer.TraceDebug <string, StringBuilder>((long)this.GetHashCode(), "Aggregated={0} Sources={1}", PropertyAggregationStrategy.GetPropertyValuePair(aggregatedProperty, aggregatedValue), stringBuilder); } }
private static string GetPropertyValuePair(PropertyDefinition property, object value) { return(PropertyAggregationStrategy.GetPropertyValuePair(property, PropertyAggregationStrategy.ObjectValueToString(value))); }