Search Results for

    Show / Hide Table of Contents

    Class CalculatedProperty

    Represents a calculated property in the Time Cockpit data model.

    Inheritance
    System.Object
    DynamicObject
    NamedDynamicObject
    ModelElement
    ModelProperty
    CalculatedProperty
    Implements
    System.Dynamic.IDynamicMetaObjectProvider
    System.ComponentModel.INotifyPropertyChanged
    System.ComponentModel.IDataErrorInfo
    INullable
    Inherited Members
    ModelProperty.IsValueAffectedByPropertyChange(EntityObject, String)
    ModelProperty.Accept(ModelElementVisitor)
    ModelProperty.ShallowCopy(String, PersistBehavior, Ownership, Boolean, Boolean)
    ModelProperty.ShallowCopy()
    ModelProperty.OnDeserializing(StreamingContext)
    ModelProperty.Attach(ModelElement)
    ModelProperty.GetHumanReadableMemberPath()
    ModelProperty.InvariantFriendlyTypeName
    ModelProperty.IsNullable
    ModelProperty.IsDefaultDisplayProperty
    ModelProperty.DefaultValueExpression
    ModelProperty.EvaluateDefaultValueExpression
    ModelProperty.HasDefaultValueExpression
    ModelProperty.DefaultValueFunction
    ModelProperty.EvaluateDefaultValueFunction
    ModelProperty.EvaluateDefaultValue
    ModelProperty.DefaultValue
    ModelProperty.Permissions
    ModelProperty.DefaultAggregateFunction
    ModelElement.IsValidIdentifier(String)
    ModelElement.Detach()
    ModelElement.SetOwnershipPrefix(String)
    ModelElement.UpdateChildren(NotifyCollectionChangedEventArgs)
    ModelElement.SetPersistBehavior(PersistBehavior)
    ModelElement.SetName(String)
    ModelElement.SetOwnership(Ownership)
    ModelElement.ElementGuid
    ModelElement.Name
    ModelElement.Parent
    ModelElement.Children
    ModelElement.PersistBehavior
    ModelElement.IsFullPersistBehavior
    ModelElement.IsNonePersistBehavior
    ModelElement.IsSystemElement
    ModelElement.IsApplicationSpecificElement
    ModelElement.IsUserElement
    ModelElement.IsSystemOrApplicationSpecificElement
    ModelElement.InvariantFriendlyName
    ModelElement.CreationVersion
    ModelElement.LastUpdateVersion
    ModelElement.Error
    ModelElement.ErrorSummary
    ModelElement.IsValid
    ModelElement.Ownership
    ModelElement.OwnershipPrefix
    ModelElement.NonPrefixedName
    NamedDynamicObject.OnPropertyChanged(String)
    NamedDynamicObject.PropertyChanged
    DynamicObject.GetMember(String)
    DynamicObject.SetMember(String, Object)
    DynamicObject.GetMetaObject(Expression)
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: TimeCockpit.Data.DataModel
    Assembly: TimeCockpit.Data.dll
    Syntax
    [FriendlyTypeName("Calculated")]
    public sealed class CalculatedProperty : ModelProperty, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo, INullable

    Constructors

    CalculatedProperty()

    Initializes a new instance of the CalculatedProperty class.

    Declaration
    public CalculatedProperty()

    CalculatedProperty(IEnumerable<KeyValuePair<Object, Object>>)

    Initializes a new instance of the CalculatedProperty class.

    Declaration
    public CalculatedProperty(IEnumerable<KeyValuePair<object, object>> properties)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.Object, System.Object>> properties

    Collection of properties.

    CalculatedProperty(CalculatedProperty)

    Initializes a new instance of the CalculatedProperty class.

    Declaration
    public CalculatedProperty(CalculatedProperty element)
    Parameters
    Type Name Description
    CalculatedProperty element

    The element.

    Properties

    ClrDefaultValue

    Gets the default value for the datatype for the property.

    Declaration
    public override object ClrDefaultValue { get; }
    Property Value
    Type Description
    System.Object
    Overrides
    ModelProperty.ClrDefaultValue

    DataType

    Gets the .NET type of the property.

    Declaration
    public override Type DataType { get; }
    Property Value
    Type Description
    System.Type
    Overrides
    ModelProperty.DataType

    FormatPattern

    Gets or sets the pattern for displaying the value of an object.

    Declaration
    public string FormatPattern { get; set; }
    Property Value
    Type Description
    System.String

    Formula

    Gets or sets the formula for the calculated property.

    Declaration
    public string Formula { get; set; }
    Property Value
    Type Description
    System.String

    Function

    Gets the CLR function for the calculated property

    Declaration
    public Func<EntityObject, object> Function { get; }
    Property Value
    Type Description
    System.Func<EntityObject, System.Object>
    Remarks

    The function needs the EntityObject on which it should operate as the first parameter.

    ShowTime

    Gets or sets a value indicating whether the time part should be shown.

    Declaration
    public bool ShowTime { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Convert(Object)

    Converts an object to the type of the property.

    Declaration
    public override object Convert(object value)
    Parameters
    Type Name Description
    System.Object value

    Object to convert.

    Returns
    Type Description
    System.Object

    Returns the converted object.

    Overrides
    ModelProperty.Convert(Object)

    Validate(ref IList<PropertyValidationMessage>, Boolean)

    Validates a ModelElement according to certain rules.

    Declaration
    protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)
    Parameters
    Type Name Description
    System.Collections.Generic.IList<PropertyValidationMessage> messages

    An list of strings that stores that picks up the validation errors of a model element.

    System.Boolean validateRecursively

    Indicates wheter to validate only the current model element or all its children (recursively) as well.

    Overrides
    ModelProperty.Validate(ref IList<PropertyValidationMessage>, Boolean)
    Remarks

    The rules the ModelElement is validated against are dependent on the type of ModelElement that is validated. This method can be overridden to provide custom validation behavior for subclasses of ModelElement

    When Validate(ref IList<PropertyValidationMessage>, Boolean) is called on a modelelement, the Validate(ref IList<PropertyValidationMessage>, Boolean) method of all children attatched to the modelelemnt are validated recursivly.

    ValidateValue(Object, out String)

    Returns true, Calculated properties cannot have invalid values.

    Declaration
    public override bool ValidateValue(object value, out string errorMessage)
    Parameters
    Type Name Description
    System.Object value

    The value to verify.

    System.String errorMessage

    The error message, always null.

    Returns
    Type Description
    System.Boolean

    Return true.

    Overrides
    ModelProperty.ValidateValue(Object, out String)
    In This Article
    • Constructors
      • CalculatedProperty()
      • CalculatedProperty(IEnumerable<KeyValuePair<Object, Object>>)
      • CalculatedProperty(CalculatedProperty)
    • Properties
      • ClrDefaultValue
      • DataType
      • FormatPattern
      • Formula
      • Function
      • ShowTime
    • Methods
      • Convert(Object)
      • Validate(ref IList<PropertyValidationMessage>, Boolean)
      • ValidateValue(Object, out String)
    Back to top Copyright © 2020 software architects gmbh