Beispiel #1
0
        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();
        }
Beispiel #2
0
 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;
     }
 }
Beispiel #3
0
 protected override void HandleDuplicatedKeyInCollection(string key, string value, key_collection keyDataCollection, string sectionName)
 {
     keyDataCollection[key] += Configuration.ConcatenateSeparator + value;
 }