Table of Contents

Class FieldDef

Namespace
Tripous.Data
Assembly
Tripous.Data.dll

A field definition

public class FieldDef : BaseDef, IDef, IJsonLoadable, INotifyPropertyChanged
Inheritance
FieldDef
Implements
Inherited Members
Extension Methods

Constructors

FieldDef()

Constructor

public FieldDef()

FieldDef(TableDef)

Constructor

public FieldDef(TableDef TableDef)

Parameters

TableDef TableDef

Properties

Alias

An alias of this field

public string Alias { get; set; }

Property Value

string

CodeProvider

Gets or sets the Name of the code producer descriptor associated to this field.

public string CodeProvider { get; set; }

Property Value

string

DataType

The data type of this field.

public DataFieldType DataType { get; set; }

Property Value

DataFieldType

Decimals

Gets or sets the decimals of the field. Used when is a float field. -1 means is not set.

public int Decimals { get; set; }

Property Value

int

DefaultValue

Gets or sets the default value of the field.

public string DefaultValue { get; set; }

Property Value

string

DisplayFormat

Gets or sets the format string to be used for displaying the field value.

public string DisplayFormat { get; set; }

Property Value

string

DisplayWidth

Gets or sets the width of the field in pixels. 0 means is not set.

public int DisplayWidth { get; set; }

Property Value

int

EditFormat

Gets or sets the format string to be used for editing the field value.

public string EditFormat { get; set; }

Property Value

string

Expression

Gets or sets the expression of the field.

public string Expression { get; set; }

Property Value

string

Flags

Gets or sets the field flags.

public FieldFlags Flags { get; set; }

Property Value

FieldFlags

Group

The group the field should be displayed into, e.g. General, Address, Billing, etc.

public string Group { get; set; }

Property Value

string

IsBindable

Returns true when this field is a bindable one, i.e. is visible and is not a blob

[JsonIgnore]
public bool IsBindable { get; }

Property Value

bool

IsBlob

Returns true when the data type is a blob type.

[JsonIgnore]
public bool IsBlob { get; }

Property Value

bool

IsBoolean

Returns true when the Boolean flag is set in Flags.

[JsonIgnore]
public bool IsBoolean { get; }

Property Value

bool

IsDateTime

Returns true when the data type is a date type.

[JsonIgnore]
public bool IsDateTime { get; }

Property Value

bool

IsExtraField

Returns true when the Extra flag is set in Flags.

[JsonIgnore]
public bool IsExtraField { get; }

Property Value

bool

IsFloat

Returns true when the data type is a float type.

[JsonIgnore]
public bool IsFloat { get; }

Property Value

bool

IsForeignKeyField

Returns true when the ForeignKey flag is set in Flags.

[JsonIgnore]
public bool IsForeignKeyField { get; }

Property Value

bool

IsHidden

Returns true when the Hidden flag is set in Flags.

[JsonIgnore]
public bool IsHidden { get; }

Property Value

bool

IsImage

Returns true when the Image flag is set in Flags.

[JsonIgnore]
public bool IsImage { get; }

Property Value

bool

IsImagePath

Returns true when the ImagePath flag is set in Flags.

[JsonIgnore]
public bool IsImagePath { get; }

Property Value

bool

IsInteger

Returns true when the data type is an integer type.

[JsonIgnore]
public bool IsInteger { get; }

Property Value

bool

IsLargeMemo

Returns true when the LargeMemo flag is set in Flags.

[JsonIgnore]
public bool IsLargeMemo { get; }

Property Value

bool

IsLocator

Returns true when this field is a locator field.

[JsonIgnore]
public bool IsLocator { get; }

Property Value

bool

IsLookup

Returns true when this field is a lookup field.

[JsonIgnore]
public bool IsLookup { get; }

Property Value

bool

IsMemo

Returns true when the Memo flag is set in Flags.

[JsonIgnore]
public bool IsMemo { get; }

Property Value

bool

IsNativeField

Returns true when the Extra flag is NOT set in Flags.

[JsonIgnore]
public bool IsNativeField { get; }

Property Value

bool

IsNoInsertOrUpdate

Returns true when the NoInsertUpdate flag is set in Flags.

[JsonIgnore]
public bool IsNoInsertOrUpdate { get; }

Property Value

bool

IsNullable

Gets or sets a value indicating whether this field is nullable.

public bool IsNullable { get; set; }

Property Value

bool

IsNumeric

Returns true when the data type is a numeric type.

[JsonIgnore]
public bool IsNumeric { get; }

Property Value

bool

IsReadOnly

Returns true when the ReadOnly flag is set in Flags.

[JsonIgnore]
public bool IsReadOnly { get; }

Property Value

bool

IsReadOnlyEdit

Returns true when the ReadOnlyEdit flag is set in Flags.

[JsonIgnore]
public bool IsReadOnlyEdit { get; }

Property Value

bool

IsReadOnlyUI

Returns true when the ReadOnlyUI flag is set in Flags.

[JsonIgnore]
public bool IsReadOnlyUI { get; }

Property Value

bool

IsRequired

Returns true when the Required flag is set in Flags.

[JsonIgnore]
public bool IsRequired { get; }

Property Value

bool

IsSearchable

Returns true when the Searchable flag is set in Flags.

[JsonIgnore]
public bool IsSearchable { get; }

Property Value

bool

IsVisible

Returns true when the Hidden flag is NOT set in Flags.

[JsonIgnore]
public bool IsVisible { get; }

Property Value

bool

Locator

Gets or sets the name of the locator descriptor associated to this field.

public string Locator { get; set; }

Property Value

string

LookupSource

Gets or sets the name of the lookup source descriptor associated to this field.

public string LookupSource { get; set; }

Property Value

string

MaxLength

Gets or sets the maximum length of the field. -1 means is not set.

public int MaxLength { get; set; }

Property Value

int

SnapshotOf

Gets or sets the source field whose value is stored as a snapshot in this field.

Expected format: TableName.FieldName, for example Product.Code.

public string SnapshotOf { get; set; }

Property Value

string

TableDef

The master definition this instance belongs to.

[JsonIgnore]
public TableDef TableDef { get; set; }

Property Value

TableDef

ToolTip

Gets or sets the ToolTip text of the field.

public string ToolTip { get; set; }

Property Value

string

Methods

AddFlags(FieldFlags)

Adds the Flags and returns this instance.

public FieldDef AddFlags(FieldFlags Value)

Parameters

Value FieldFlags

Returns

FieldDef

CheckDescriptor()

Throws an exception if this descriptor is not fully defined

public override void CheckDescriptor()

GetTitleKey()

Overrides GetTitleKey() to return the Alias of this field if this is a field of a join table.

protected override string GetTitleKey()

Returns

string

SetAlias(string)

Sets the Alias and returns this instance.

public FieldDef SetAlias(string Value)

Parameters

Value string

Returns

FieldDef

SetCodeProviderName(string)

Sets the CodeProvider and returns this instance.

public FieldDef SetCodeProviderName(string Value)

Parameters

Value string

Returns

FieldDef

SetDecimals(int)

Sets the Decimals and returns this instance.

public FieldDef SetDecimals(int Value)

Parameters

Value int

Returns

FieldDef

SetDefaultValue(string)

Sets the DefaultValue and returns this instance.

public FieldDef SetDefaultValue(string Value)

Parameters

Value string

Returns

FieldDef

SetExpression(string)

Sets the Expression and returns this instance.

public FieldDef SetExpression(string Value)

Parameters

Value string

Returns

FieldDef

SetFlags(FieldFlags)

Sets the Flags and returns this instance.

public FieldDef SetFlags(FieldFlags Value)

Parameters

Value FieldFlags

Returns

FieldDef

SetGroup(string)

Sets the Group and returns this instance.

public FieldDef SetGroup(string Value)

Parameters

Value string

Returns

FieldDef

SetLargeMemo()

Sets the LargeMemo FieldFlags flag and returns this instance."

public FieldDef SetLargeMemo()

Returns

FieldDef

SetMaxLength(int)

Sets the MaxLength and returns this instance.

public FieldDef SetMaxLength(int Value)

Parameters

Value int

Returns

FieldDef

SetMemo()

Sets the Memo FieldFlags flag and returns this instance."

public FieldDef SetMemo()

Returns

FieldDef

SetNullable(bool)

Sets the SetNullable(bool) and returns this instance.

public FieldDef SetNullable(bool Value)

Parameters

Value bool

Returns

FieldDef

SetSnapshotOf(string)

Sets the SnapshotOf and returns this instance.

public FieldDef SetSnapshotOf(string Value)

Parameters

Value string

Returns

FieldDef

SetTitleKey(string)

Sets the TitleKey and returns this instance.

public FieldDef SetTitleKey(string Value)

Parameters

Value string

Returns

FieldDef

ToString()

Returns a string representation of this instance.

public override string ToString()

Returns

string