Пример #1
0
        /// <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(key, value);

            ret.FormatDefault();
            return(ret);
        }
Пример #2
0
        /// <summary>Creates a new IniFileValue object basing on a key and a value and the formatting  of this IniFileValue.</summary>
        /// <param name="pKey">Name of value</param>
        /// <param name="pValue">Value</param>
        public IniFileValue CreateNew(string pKey, string pValue)
        {
            IniFileValue ret = new IniFileValue(pKey, pValue);

            if (IniFileEx.PreserveFormatting)
            {
                ret.fFormatting = fFormatting;
                if (IniFileEx.AllowInlineComments)
                {
                    ret.fInlineCommentChar = fInlineCommentChar;
                }
                ret.Format();
            }
            else
            {
                ret.FormatDefault();
            }

            return(ret);
        }