private void TransferToIni()
{
if (_iniData == null) _iniData = new IniData();
_iniData.Sections.RemoveSection("__global__section__"); // Throw away section-less data
if (!_iniData.Sections.ContainsSection(GlobalSection)) _iniData.Sections.AddSection(GlobalSection);
var global = _iniData[GlobalSection];
foreach (var property in _metaData)
{
string key = property.Key;
if (property.Value.NeedsEncoding) key += Base64Suffix;
if (property.Value.IsDefaultValue || property.Value.Value == null)
global.RemoveKey(key);
else
{
global[key] = property.Value.NeedsEncoding
? property.Value.Value.Base64Utf8Encode()
: property.Value.Value;
}
}
}