Example #1
0
        /// <summary>
        /// Inserts the field into position before the first field found with a higher tag number.
        /// This assumes the record has already been sorted.
        /// </summary>
        /// <param name="newField">The field.</param>
        public void InsertField(Field newField)
        {
            int rowNum = 0;
            foreach (Field field in Fields)
            {
                if (field.Tag.CompareTo(newField.Tag) > 0)
                {
                    Fields.Insert(rowNum, newField);
                    return;
                }

                rowNum++;
            }

            //Insert at the end
            Fields.Add(newField);
        }