Exemple #1
0
        internal string GetSetting(SectionPair sectionPair)
        {
            var value = _data[sectionPair];

            if (value.Count > 1)
            {
                throw new InvalidOperationException("Section contains multiple values");
            }

            return(value[0]);
        }
Exemple #2
0
 internal void AddSetting(SectionPair sectionPair, string sectionValue)
 {
     if (!_data.ContainsKey(sectionPair))
     {
         _data.Add(sectionPair, new List <string> {
             sectionValue
         });
     }
     else
     {
         _data[sectionPair].Add(sectionValue);
     }
 }
        private KeyValuePair <SectionPair, string> ReadSectionPair(string line, string sectionName)
        {
            var pair = line.Split(new[] { UnrealIniSyntax.KeyValuePairDelimeter }, 2);

            string value = null;

            var sectionPair = new SectionPair {
                Section = sectionName, Key = pair[0]
            };

            if (pair.Length > 1)
            {
                value = pair[1];
            }

            return(new KeyValuePair <SectionPair, string>(sectionPair, value));
        }
Exemple #4
0
        internal string GetSetting(SectionPair sectionPair)
        {
            var value = _data[sectionPair];

            if (value.Count > 1)
                throw new InvalidOperationException("Section contains multiple values");

            return value[0];
        }
Exemple #5
0
 internal string[] GetMultilineSetting(SectionPair sectionPair)
 {
     return _data[sectionPair].ToArray();
 }
Exemple #6
0
 internal void AddSetting(SectionPair sectionPair, string sectionValue)
 {
     if (!_data.ContainsKey(sectionPair))
         _data.Add(sectionPair, new List<string> { sectionValue });
     else
         _data[sectionPair].Add(sectionValue);
 }
Exemple #7
0
 internal string[] GetMultilineSetting(SectionPair sectionPair)
 {
     return(_data[sectionPair].ToArray());
 }