示例#1
0
 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);
     }
 }
示例#2
0
 private ApplicationAggregatedProperty(string displayName, Type valueType, PropertyFlags propertyFlags, PropertyAggregationStrategy propertyAggregationStrategy, SortByAndFilterStrategy sortByAndFilterStrategy, SimpleVirtualPropertyDefinition aggregatedProperty) : base(displayName, valueType, propertyFlags, PropertyDefinitionConstraint.None, propertyAggregationStrategy.Dependencies)
 {
     this.propertyAggregationStrategy = propertyAggregationStrategy;
     this.sortByAndFilterStrategy     = sortByAndFilterStrategy;
     this.aggregatedProperty          = aggregatedProperty;
 }
示例#3
0
 public ApplicationAggregatedProperty(ApplicationAggregatedProperty basePropertyDefinition, PropertyAggregationStrategy propertyAggregationStrategy) : this(basePropertyDefinition.Name, basePropertyDefinition.Type, basePropertyDefinition.PropertyFlags, propertyAggregationStrategy, basePropertyDefinition.sortByAndFilterStrategy, basePropertyDefinition.aggregatedProperty)
 {
 }
示例#4
0
 public ApplicationAggregatedProperty(string displayName, Type valueType, PropertyFlags propertyFlags, PropertyAggregationStrategy propertyAggregationStrategy, SortByAndFilterStrategy sortByAndFilterStrategy) : this(displayName, valueType, propertyFlags, propertyAggregationStrategy, sortByAndFilterStrategy, new SimpleVirtualPropertyDefinition("InternalStorage:" + displayName, valueType, propertyFlags, new PropertyDefinitionConstraint[0]))
 {
 }
示例#5
0
 private static string GetPropertyValuePair(PropertyDefinition property, object value)
 {
     return(PropertyAggregationStrategy.GetPropertyValuePair(property, PropertyAggregationStrategy.ObjectValueToString(value)));
 }