Search Results for

    Show / Hide Table of Contents

    Class AtomicExpression

    Base class for filter expressions. Expressions can be atomic or composed.

    Inheritance
    object
    FilterExpression
    AtomicExpression
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.TranslationMemory
    Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
    Syntax
    [DataContract]
    public class AtomicExpression : FilterExpression

    Constructors

    AtomicExpression(FieldValue, Operator)

    Initializes a new instance of the AtomicExpression class with the given field, value and operator. Throws an error if the field type is not compatible with the operator.

    Declaration
    public AtomicExpression(FieldValue value, AtomicExpression.Operator op)
    Parameters
    Type Name Description
    FieldValue value

    The field value containing both the field name and the value to use for comparison.

    AtomicExpression.Operator op

    The operator.

    Properties

    Op

    Gets or sets the operator for this atomic expression. Throws an error if the field type is not compatible with a specific operator.

    See description of enum Operator values for a list of compatible types and operators.

    Declaration
    [DataMember(Order = 1)]
    public AtomicExpression.Operator Op { get; set; }
    Property Value
    Type Description
    AtomicExpression.Operator

    Value

    Gets or sets the Value for this atomic expression. This property contains both the left and right operands. The Name property of the field represents the left operand and the Value property represents the right operand.

    This property should be set before the operator Op property.

    Declaration
    [DataMember(Order = 0)]
    public FieldValue Value { get; set; }
    Property Value
    Type Description
    FieldValue

    Methods

    Evaluate(ITypedKeyValueContainer)

    Evaluates a filter expression for a given a set of field values.

    Declaration
    public override bool Evaluate(ITypedKeyValueContainer values)
    Parameters
    Type Name Description
    ITypedKeyValueContainer values

    A set of field values.

    Returns
    Type Description
    bool

    true if the field values satisfy the expression, false otherwise.

    Overrides
    FilterExpression.Evaluate(ITypedKeyValueContainer)

    ToString()

    ToString()

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    A string representation of the object, for display purposes.

    Overrides
    object.ToString()

    Validate(IFieldDefinitions, bool)

    Validates the filter expression against the provided field definitions.

    Declaration
    public override bool Validate(IFieldDefinitions fields, bool throwIfInvalid)
    Parameters
    Type Name Description
    IFieldDefinitions fields

    The field definitions to validate against.

    bool throwIfInvalid

    If true, an exception will be thrown if invalid field names are encountered. If false, the return value will be set to false without an exception being thrown.

    Returns
    Type Description
    bool

    true if the filter expression is valid, given the provided field definitions. false otherwise.

    Overrides
    FilterExpression.Validate(IFieldDefinitions, bool)
    In this article
    • Constructors
      • AtomicExpression(FieldValue, Operator)
    • Properties
      • Op
      • Value
    • Methods
      • Evaluate(ITypedKeyValueContainer)
      • ToString()
      • Validate(IFieldDefinitions, bool)
    Back to top Generated by DocFX