using System;
using System.Collections.Generic;
// ReSharper disable StringLiteralTypo
// ReSharper disable IdentifierTypo
namespace DotNetDBF.Enumerable
{
///
/// Interface to get the contents of the DBF Wrapper
///
///
[Obsolete("DotNetDBF.Enumerable.IDBFInterceptor is the new interface name",error:true)]
public interface IDBFIntercepter:IDBFInterceptor
{
}
[Obsolete("DotNetDBF.Enumerable.DBFInterceptor is the new class name")]
public class DBFIntercepter : DBFEnumerable.DBFIntercepter
{
public DBFIntercepter(object[] wrappedObj, string[] fieldNames) : base(wrappedObj, fieldNames)
{
}
}
}
namespace DotNetDBF.Enumerable
{
public static partial class DBFEnumerable
{
[Obsolete("DotNetDBF.Enumerable.IDBFIntercepter is the new interface name")]
public interface IDBFIntercepter : DotNetDBF.Enumerable.IDBFIntercepter
{
}
[Obsolete("DotNetDBF.Enumerable.DBFIntercepter is the new class name")]
public class DBFIntercepter : DotNetDBF.Enumerable.Enuemrable.DBFIntercepter, IDBFIntercepter
{
public DBFIntercepter(object[] wrappedObj, string[] fieldNames)
: base(wrappedObj, fieldNames)
{
}
}
}
[Obsolete("DBFEnumerable is the new class name")]
public static class Enuemrable
{
///
/// New Blank Row Dynamic object that matches writer;
///
/// The writer.
///
public static dynamic NewBlankRow(DBFWriter writer)
{
return writer.NewBlankRow();
}
///
/// Writes the record.
///
/// The writer.
/// The value.
public static void WriteRecord(DBFWriter writer, IDBFIntercepter value)
{
writer.WriteRecord(value);
}
///
/// Adds the record.
///
/// The writer.
/// The value.
public static void AddRecord(DBFWriter writer, IDBFIntercepter value)
{
writer.AddRecord(writer, value);
}
///
/// Return all the records. T should be interface with getter properties that match types and names of the database.
/// Optionally instead of T being and interface you can pass in an anonymous object with properties that match that
/// database and then you'll get an IEnumerable of that anonymous type with the data filled in.
///
///
/// The reader.
/// The prototype. Anonymous class instance
///
public static IEnumerable AllRecords(DBFReader reader, T prototype = null) where T : class
{
return reader.AllRecords(prototype);
}
///
/// Returns a list of dynamic objects whose properties and types match up with that database name.
///
/// The reader.
/// The where column name.
/// What the were column should equal.
///
public static IEnumerable DynamicAllRecords(DBFReader reader, string whereColumn = null,
dynamic whereColumnEquals = null)
{
return reader.DynamicAllRecords(whereColumn, (object) whereColumnEquals);
}
[Obsolete("DotNetDBF.Enumerable.IDBFIntercepter is the new interface name",error:true)]
public interface IDBFIntercepter : DotNetDBF.Enumerable.IDBFInterceptor
{
}
[Obsolete("DotNetDBF.Enumerable.DBFIntercepter is the new class name")]
public class DBFIntercepter : DotNetDBF.Enumerable.BaseDBFInterceptor, IDBFIntercepter
{
public DBFIntercepter(object[] wrappedObj, string[] fieldNames)
: base(wrappedObj, fieldNames)
{
}
}
}
}