FieldEvaluatorEvaluate Method

Evaluates a field.

Namespace: Teigha.DatabaseServices
Assembly: TD_Mgd (in TD_Mgd.dll) Version: 24.2.0.0
Syntax
public abstract void Evaluate(
        Field pField,
        int nContext,
        Database pDb,
        FieldResult pResult
)

Parameters

pField  Field
[in] Field to evaluate.
nContext  Int32
[in] Context in which the field is evaluated; this context flag is passed to the evaluator and can be one of the predefined FieldEvaluationOptions enum flags or a user-defined context flag.
pDb  Database
[in] Database pointer, which can be null if a database could not be obtained in the current context.
pResult  FieldResult
[in] Field result object to set the evaluation result and status.
Remarks
This function is called by the field framework when the field needs to be evaluated. A field is evaluated only when the evaluation option set in the field matches the context in which the field evaluation is invoked. For example, if a field option is set to evaluate only manually, it is evaluated only when you update the specific field or all fields in the drawing manually. The evaluator should evaluate the field and set the evaluated value using the FieldResult.setFieldValue() method and the error status using the FieldResult.setEvaluationStatus() method in the passed resulting object, which in turn sets them in the field object. The passed database pointer may be null if the field is not database-resident and a database could not be obtained in the current context. If the field evaluation requires a database, this method can set the evaluation error status in the field resulting object and return an error. If the evaluation fails, the previously cached result in the field object can be left intact and used as the field value. Alternatively, the cached result can be deleted and substituted with an error string (for example, "#ERR"), which is displayed as a field value.
See Also

©  Bricsys NV. All rights reserved.