/// <summary>Creates a new IniFileValue object basing on a key and a value and the formatting  of this IniFileValue.</summary>
 /// <param name="key">Name of value</param>
 /// <param name="value">Value</param>
 public IniFileValue CreateNew(string key, string value)
 {
     IniFileValue ret = new IniFileValue();
     ret.key = key; ret.value = value;
     if (IniFileSettings.PreserveFormatting)
     {
         ret.formatting = formatting;
         if (IniFileSettings.AllowInlineComments)
             ret.inlineCommentChar = inlineCommentChar;
         ret.Format();
     }
     else
         ret.FormatDefault();
     return ret;
 }
 /// <summary>Parses a single line.</summary>
 /// <param name="line">Text to parse.</param>
 public static IniFileElement ParseLine(string line)
 {
     if (line == null)
         return null;
     if (line.Contains("\n"))
         throw new ArgumentException("String passed to the ParseLine method cannot contain more than one line.");
     string trim = line.Trim();
     IniFileElement elem = null;
     if (IniFileBlankLine.IsLineValid(trim))
         elem = new IniFileBlankLine(1);
     else if (IniFileCommentary.IsLineValid(line))
         elem = new IniFileCommentary(line);
     else if (IniFileSectionStart.IsLineValid(trim))
         elem = new IniFileSectionStart(line);
     else if (IniFileValue.IsLineValid(trim))
         elem = new IniFileValue(line);
     return elem ?? new IniFileElement(line);
 }
 /// <summary>Crates a IniFileValue object from it's data.</summary>
 /// <param name="key">Value name.</param>
 /// <param name="value">Associated value.</param>
 public static IniFileValue FromData(string key, string value)
 {
     IniFileValue ret = new IniFileValue();
     ret.key = key; ret.value = value;
     ret.FormatDefault();
     return ret;
 }