示例#1
0
        /// <summary>
        /// Call AddStrings to add the strings from another TStrings object to the list. If both the source and destination TStrings objects support objects associated with their strings, references to the associated objects will be added as well.  
        /// </summary>
        /// <param name="strings"></param>
        public void AddStrings(TStrings strings)
        {
            for (int i = 0; i < strings.Count; i++)
            {
                int ind = this.Add(strings[i]);

                if (strings.GetObject(i) != null)
                {
                    this.SetObject(ind, strings.GetObject(i));
                }
                ;
            }
            ;
        }
示例#2
0
        /// <summary>
        /// Flushes buffered INI file data to disk.
        /// </summary>

        public bool UpdateFile()
        {
            TStrings IniFile = new TStrings();
            TStrings Section;

            for (int i = 0; i < FSections.Count; i++)
            {
                IniFile.Add("[" + FSections[i] + "]");

                Section = (FSections.GetObject(i) as TStrings);

                for (int j = 0; j < Section.Count; j++)
                {
                    IniFile.Add(Section[j]);
                }
                ;

                IniFile.Add("");
            }
            ;

            IniFile.SaveToFile(FFileName, System.Text.Encoding.Unicode);

            return(true);
        }