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); }
/// <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(); } }
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); }
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); }