Exemplo n.º 1
0
        public SubFieldCollection AssignClone
        (
            [NotNull] SubFieldCollection other
        )
        {
            ThrowIfReadOnly();
            Sure.NotNull(other, "other");

            Clear();
            _field = other.Field;
            foreach (SubField subField in other)
            {
                Add(subField.Clone());
            }

            return(this);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 public SubField
 (
     char code,
     [CanBeNull] string value,
     bool readOnly,
     [CanBeNull] RecordField field
 )
 {
     Code  = code;
     Value = value;
     Field = field;
     NotModified();
     if (readOnly)
     {
         SetReadOnly();
     }
 }
Exemplo n.º 3
0
        public static MarcRecord SetField
        (
            [NotNull] this MarcRecord record,
            int tag,
            int occurrence,
            string newText
        )
        {
            Sure.NotNull(record, "record");
            Sure.Positive(tag, "tag");

            RecordField field = record.Fields.GetField(tag, occurrence);

            if (!ReferenceEquals(field, null))
            {
                field.SubFields.Clear();
                field.Value = newText;
            }

            return(record);
        }
Exemplo n.º 4
0
        public static MarcRecord SetSubField
        (
            [NotNull] this MarcRecord record,
            int tag,
            char code,
            [CanBeNull] string newValue
        )
        {
            Sure.NotNull(record, "record");
            Sure.Positive(tag, "tag");

            RecordField field = record.Fields.GetFirstField(tag);

            if (ReferenceEquals(field, null))
            {
                field = new RecordField(tag);
                record.Fields.Add(field);
            }

            field.SetSubField(code, newValue);

            return(record);
        }