private void AddKeyToKeyValueCollection(string key, string value, key_collection keyDataCollection, string sectionName) { if (keyDataCollection.ContainsKey(key)) { HandleDuplicatedKeyInCollection(key, value, keyDataCollection, sectionName); } else { keyDataCollection.AddKey(key, value); } keyDataCollection.GetKeyData(key).Comments = _currentCommentListTemp; _currentCommentListTemp.Clear(); }
protected virtual void HandleDuplicatedKeyInCollection(string key, string value, key_collection keyDataCollection, string sectionName) { if (!Configuration.AllowDuplicateKeys) { throw new ParsingException(string.Format("Duplicated key '{0}' found in section '{1}", key, sectionName)); } else if (Configuration.OverrideDuplicateKeys) { keyDataCollection[key] = value; } }
protected override void HandleDuplicatedKeyInCollection(string key, string value, key_collection keyDataCollection, string sectionName) { keyDataCollection[key] += Configuration.ConcatenateSeparator + value; }