public object this[DbfField field] { get { int index = fields.IndexOf(field); if (index == -1) { return(null); } return(Data[index]); } }
public DbfField AddNewField(string name, DbfFieldType type, int length) { if (type == DbfFieldType.Memo) { if (Header.Version == DbfVersion.dBase4SQLSystemNoMemo || Header.Version == DbfVersion.dBase4SQLTableNoMemo || Header.Version == DbfVersion.FoxBaseDBase3NoMemo) { throw new InvalidOperationException("Memo fields are not supported for this database version."); } if (Memo == null) { Memo = CreateMemo(); } } var field = new DbfField(name, type, length, _encoding); Fields.Add(field); return(field); }
public object this[DbfField field] { get => this[field.Name]; set => this[field.Name] = value;