Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 public void UpdateCombination(IncludeCombination combination)
 {
     _storage.Store(combination);
 }