Esempio n. 1
0
        /// <inheritdoc cref="IReadOnly{T}.AsReadOnly" />
        public RecordFieldCollection AsReadOnly()
        {
            RecordFieldCollection result = Clone();

            result.SetReadOnly();

            return(result);
        }
Esempio n. 2
0
        public RecordFieldCollection Clone()
        {
            RecordFieldCollection result = new RecordFieldCollection
            {
                _record = Record
            };

            foreach (RecordField field in this)
            {
                RecordField clone = field.Clone();
                clone.Record = Record;
                result.Add(clone);
            }

            return(result);
        }
Esempio n. 3
0
        /// <summary>
        /// Нет ни одного поля с указанным тегом?
        /// </summary>
        public static bool HaveNotField
        (
            this MarcRecord record,
            int tag
        )
        {
            RecordFieldCollection fields = record.Fields;

            for (int i = 0; i < fields.Count; i++)
            {
                if (fields[i].Tag == tag)
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 4
0
        /// <summary>
        /// Нет ни одного поля с указанными тегами?
        /// </summary>
        public static bool HaveNotField
        (
            this MarcRecord record,
            params int[] tags
        )
        {
            RecordFieldCollection fields = record.Fields;

            for (int i = 0; i < fields.Count; i++)
            {
                if (fields[i].Tag.OneOf(tags))
                {
                    return(false);
                }
            }

            return(true);
        }