|
using System;
namespace DbfDotNet
{
public class ColumnAttribute : Attribute
{
string mColumnName;
int mWidth;
int mDecimals;
OverflowBehaviour mOverflowBehaviour;
ColumnType mColumnType;
public ColumnAttribute()
{
mWidth = -1;
mDecimals = -1;
mColumnType = ColumnType.UNKNOWN;
}
public string ColumnName
{
get { return mColumnName; }
set { mColumnName = value; }
}
/// <summary>
/// Full width of the column (including dot and decimals).
/// </summary>
[System.ComponentModel.Description("Full width of the column (including dot and decimals)")]
public int Width
{
get { return mWidth; }
set { mWidth = value; }
}
public int Decimals
{
get { return mDecimals; }
set { mDecimals = value; }
}
public OverflowBehaviour OverflowBehaviour
{
get { return mOverflowBehaviour; }
set { mOverflowBehaviour = value; }
}
public ColumnType Type
{
get { return mColumnType; }
set { mColumnType = value; }
}
}
public class RecordAttribute : Attribute
{
DbfVersion mVersion;
FieldMapping mColumnMapping;
OverflowBehaviour mOverflowBehaviour;
int mWidth;
public RecordAttribute()
{
mColumnMapping = FieldMapping.PrivateFields | FieldMapping.PublicFields;
mOverflowBehaviour = OverflowBehaviour.ThrowError;
}
public DbfVersion Version
{
get { return mVersion; }
set { mVersion = value; }
}
public FieldMapping FieldMapping
{
get { return mColumnMapping; }
set { mColumnMapping = value; }
}
public OverflowBehaviour OverflowBehaviour
{
get { return mOverflowBehaviour; }
set { mOverflowBehaviour = value; }
}
public int Width
{
get { return mWidth; }
set { mWidth = Width; }
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
I am a French programmer.
These days I spend most of my time with the .NET framework, JavaScript and html.