Beispiel #1
0
        /// <summary>
        /// Handle content and add to Values variable fields
        /// </summary>
        /// <param name="content">Ini string</param>
        private void GetFieldsFromContent(string content)
        {
            IniSection scope = null;

            var rows = content.Replace("\r", "").Split('\n');

            foreach (var row in rows)
            {
                if (row.StartsWith(";") || string.IsNullOrWhiteSpace(row))
                {
                    continue;
                }
                if (row.StartsWith("[") && row.EndsWith("]"))
                {
                    scope = GetScope(row);
                    continue;
                }

                GetValueFromField(row, scope);
            }
        }
Beispiel #2
0
 /// <summary>
 /// Get values from section or IniRoot
 /// </summary>
 /// <param name="scope">Null or section</param>
 /// <returns>Values from scope or values IniRoot</returns>
 private List <Ini> GetValues(IniSection scope) =>
 scope?.Values ?? Values;