Exemplo n.º 1
0
        /// <inheritdoc />
        internal override void SetAggregateFunctionToAggregateDescription(IAggregateDescription aggregateDescription, object aggregateFunction)
        {
            PropertyAggregateDescriptionBase padb = aggregateDescription as PropertyAggregateDescriptionBase;
            AggregateFunction af = aggregateFunction as AggregateFunction;

            if (padb != null && af != null)
            {
                padb.AggregateFunction = af;
            }
        }
Exemplo n.º 2
0
        private static string DefaultSelectionMethod(Type dataType, PropertyAggregateDescriptionBase aggregateDescription)
        {
            string stringFormat = aggregateDescription.StringFormat;

            if (aggregateDescription.AggregateFunction != null)
            {
                stringFormat = aggregateDescription.AggregateFunction.GetStringFormat(dataType, stringFormat);
            }

            IAggregateDescription aggregateDescriptionInternal = (IAggregateDescription)aggregateDescription;

            if (aggregateDescriptionInternal.TotalFormat != null)
            {
                stringFormat = aggregateDescriptionInternal.TotalFormat.GetStringFormat(dataType, stringFormat);
            }

            return(stringFormat);
        }
Exemplo n.º 3
0
 internal static string SelectStringFormat(StringFormatSelector selector, Type dataType, PropertyAggregateDescriptionBase aggregateDescription)
 {
     if (selector != null)
     {
         return(selector.SelectStringFormat(dataType, aggregateDescription));
     }
     else
     {
         return(DefaultSelectionMethod(dataType, aggregateDescription));
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Select a StringFormat suitable to format the <see cref="AggregateValue"/>s provided for the <paramref name="aggregateDescription"/> and <paramref name="dataType"/>.
 /// </summary>
 /// <param name="dataType">The type of the data items.</param>
 /// <param name="aggregateDescription">The <see cref="PropertyAggregateDescriptionBase"/> for which <see cref="AggregateValue"/>s a StringFormat is selected.</param>
 /// <returns>A string format.</returns>
 public virtual string SelectStringFormat(Type dataType, PropertyAggregateDescriptionBase aggregateDescription)
 {
     return(DefaultSelectionMethod(dataType, aggregateDescription));
 }