public void AnalyzeData() { _logger.DebugFormat("Start Analyze Data"); _dDimensionGroupingDefinitions = new Dictionary <string, Combine2DDimensionGroupingDefinition>(); _keyDictionary = new Dictionary <string, CombineDataKey>(); _dataDictionary = new Dictionary <CombineDataKey, CombineDataResult>(); LoopGroupDefinitionX(_dDimensionGroupingDefinitions, this.GroupingX, this.GroupingY); foreach (var dataItem in this.Data) { bool checkOk = true; if (DataFiltering != null) { checkOk = DataFiltering.PerformCheck(dataItem); } if (checkOk) { foreach (var combineGroupingDefinition in _dDimensionGroupingDefinitions.Values) { CombineDataKey combineDataKey = this.GetDataCombineGroupKey(combineGroupingDefinition, dataItem); if (_keyDictionary.ContainsKey(combineDataKey.CombineKey) == false) { _keyDictionary.Add(combineDataKey.CombineKey, combineDataKey); } else { combineDataKey = _keyDictionary[combineDataKey.CombineKey]; } CombineDataResult dataResult = null; if (_dataDictionary.TryGetValue(combineDataKey, out dataResult) == false) { dataResult = new CombineDataResult(combineDataKey, this.CalculateDefinitions); _dataDictionary.Add(combineDataKey, dataResult); } dataResult.AddData(dataItem); } } } _logger.DebugFormat("Finish Analyze Data"); }
public void AnalyzeData() { _logger.DebugFormat("Start Analyze Data"); _dDimensionGroupingDefinitions = new Dictionary<string, Combine2DDimensionGroupingDefinition>(); _keyDictionary = new Dictionary<string, CombineDataKey>(); _dataDictionary = new Dictionary<CombineDataKey, CombineDataResult>(); LoopGroupDefinitionX(_dDimensionGroupingDefinitions, this.GroupingX, this.GroupingY); foreach (var dataItem in this.Data) { bool checkOk = true; if (DataFiltering != null) { checkOk = DataFiltering.PerformCheck(dataItem); } if (checkOk) { foreach (var combineGroupingDefinition in _dDimensionGroupingDefinitions.Values) { CombineDataKey combineDataKey = this.GetDataCombineGroupKey(combineGroupingDefinition, dataItem); if (_keyDictionary.ContainsKey(combineDataKey.CombineKey) == false) { _keyDictionary.Add(combineDataKey.CombineKey, combineDataKey); } else { combineDataKey = _keyDictionary[combineDataKey.CombineKey]; } CombineDataResult dataResult = null; if (_dataDictionary.TryGetValue(combineDataKey, out dataResult) == false) { dataResult = new CombineDataResult(combineDataKey, this.CalculateDefinitions); _dataDictionary.Add(combineDataKey, dataResult); } dataResult.AddData(dataItem); } } } _logger.DebugFormat("Finish Analyze Data"); }