/// <summary> /// Initializes a new instance of the <see cref="DateTimePivot<TCollection, T, TCategory, TSubSummary>"/> class. /// </summary> /// <param name="category">The category.</param> /// <param name="entityCollection">The entity collection.</param> /// <param name="dateTimePivotSetting">The date time pivot setting.</param> public DateTimePivot( TCategory category , TCollection entityCollection , Framework.EntityContracts.QuerySystemDateTimeRangeCriteria criteria , Framework.EntityContracts.DateTimePivotEntities.DateTimePivotSetting dateTimePivotSetting) : this(category, entityCollection, dateTimePivotSetting.CalculateConsecutiveDistributionCriteria(criteria)) { }
/// <summary> /// Initializes a new instance of the <see cref="DateTimePivotCollection<TCollection, T, TCategoryCollection, TCategory, TSubSummary>"/> class. /// </summary> /// <param name="categoryCollection">The category collection.</param> /// <param name="entityCollection">The entity collection.</param> /// <param name="func_GetEntityCollectionOfOneCategory">The func_ get entity collection of one category.</param> /// <param name="dateTimePivotSetting">The date time pivot setting.</param> /// <param name="func_GetEntityCollectionOfOneCriteria">The func_ get entity collection of one criteria.</param> /// <param name="func_CalculateSubSummary">The func_ calculate sub summary.</param> public DateTimePivotCollection( TCategoryCollection categoryCollection , TCollection entityCollection , Framework.EntityContracts.QuerySystemDateTimeRangeCriteria criteria , Func <TCategory, TCollection, TCollection> func_GetEntityCollectionOfOneCategory , Framework.EntityContracts.DateTimePivotEntities.DateTimePivotSetting dateTimePivotSetting , Func <Framework.EntityContracts.QuerySystemDateTimeRangeCriteria, TCollection, TCollection> func_GetEntityCollectionOfOneCriteria , Func <TCollection, TSubSummary> func_CalculateSubSummary ) { Framework.EntityContracts.QuerySystemDateTimeRangeCriteria[] _ConsecutiveDistributionCriteria = dateTimePivotSetting.CalculateConsecutiveDistributionCriteria(criteria); // some problems here. foreach (TCategory _Category in categoryCollection) { this.Add(_Category, func_GetEntityCollectionOfOneCategory(_Category, entityCollection), criteria, dateTimePivotSetting.DateTimeUnitOfInterval, dateTimePivotSetting.Interval); } foreach (var _OneItem in this) { List <TCollection> _Distributed = new List <TCollection>(); foreach (var _OneCriteria in _ConsecutiveDistributionCriteria) { _Distributed.Add(_OneItem.GetEntityCollectionOfOneCriteria(_OneCriteria, func_GetEntityCollectionOfOneCriteria)); } _OneItem.DistributedEntityCollection = _Distributed.ToArray(); _OneItem.SubSummary = _OneItem.CalculateSubSummary(func_CalculateSubSummary); } }