Example #1
0
 public object this[DbfField field]
 {
     get
     {
         int index = fields.IndexOf(field);
         if (index == -1)
         {
             return(null);
         }
         return(Data[index]);
     }
 }
Example #2
0
        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);
        }
Example #3
0
 public object this[DbfField field]
 {
     get => this[field.Name];
     set => this[field.Name] = value;