public IncludeCombinationResult(IIncludeCombiner combiner, string key, DateTime now) { if (combiner == null) { throw new ArgumentNullException("combiner"); } if (string.IsNullOrEmpty(key)) { throw new ArgumentException("key"); } _key = key; _now = now; Combination = combiner.GetCombination(_key); }
public string RegisterCombination(IEnumerable <string> sources, IncludeType type, DateTime now) { var combinedContent = new StringBuilder(); foreach (var source in sources) { var include = RegisterInclude(source, type); combinedContent.Append(include.Content).AppendLine(); } var combination = new IncludeCombination(type, sources, combinedContent.ToString(), now, _settings.Types[type]); var key = _storage.Store(combination); return(key); }
public string Store(IncludeCombination combination) { if (combination == null) { throw new ArgumentNullException("combination"); } var key = _keyGen.Generate(combination.Sources); if (!_combinations.ContainsKey(key)) { _combinations.Add(key, combination); } else { _combinations[key] = combination; } return(key); }
public void UpdateCombination(IncludeCombination combination) { _storage.Store(combination); }