Table of Contents

Class FileProperty

Namespace
TimeCockpit.Data.DataModel
Assembly
TimeCockpit.Data.dll

Represents a FileProperty in the data model.

FilePropertys are actually splitted into four different columns in the database. It actually consists of a file name, a file mime type, the size and the actual content of the property. The FileProperty is a kind of wrapper that holds only references to the columns via their name.

The creation of a FileProperty does not create the other properties that hold, e.g. the name of the size. Users of the framework or a UI need to handle the creation of the according properties.
[DataType(typeof(byte[]))]
[Column(typeof(byte[]), SizePropertyName = "MaxStorageSize")]
[DefaultValue(new byte[]{})]
[FriendlyTypeName("Binary")]
public class FileProperty : BinaryProperty, IDynamicMetaObjectProvider, INotifyPropertyChanged, IDataErrorInfo, INullable
Inheritance
Object
FileProperty
Implements
IDynamicMetaObjectProvider
INotifyPropertyChanged
IDataErrorInfo
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Constructors

FileProperty()

Initializes a new instance of the FileProperty class

public FileProperty()

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

Initializes a new instance of the FileProperty class

public FileProperty(IEnumerable<KeyValuePair<object, object>> properties)

Parameters

properties IEnumerable<KeyValuePair<Object, Object>>

Collection of properties

FileProperty(FileProperty)

Initializes a new instance of the FileProperty class.

public FileProperty(FileProperty element)

Parameters

element FileProperty

The element.

Properties

AllowedExtensions

Gets or sets the allowed extensions of the property.

public IEnumerable<string> AllowedExtensions { get; set; }

Property Value

IEnumerable<String>

AllowedMimeTypes

Gets or sets the allowed mime types of the property. If more than one mime types are set.

public IEnumerable<string> AllowedMimeTypes { get; set; }

Property Value

IEnumerable<String>

ClrDefaultValue

Gets the default valud for the datatype for the property.

public override object ClrDefaultValue { get; }

Property Value

Object

DataType

Gets the datatype for the property.

public override Type DataType { get; }

Property Value

Type

FileMimeTypeColumn

Gets or sets the mime type of the file.

public string FileMimeTypeColumn { get; set; }

Property Value

String

FileNameColumn

Gets or sets the file name.

public string FileNameColumn { get; set; }

Property Value

String

FileSizeColumn

Gets or sets the size of the file.

public string FileSizeColumn { get; set; }

Property Value

String

MaxFileSizeInKB

Gets or sets the maximum file size of the uploaded file

public long MaxFileSizeInKB { get; set; }

Property Value

Int64

Methods

Validate(ref IList<PropertyValidationMessage>, Boolean)

Validates a ModelElement according to certain rules.

protected override void Validate(ref IList<PropertyValidationMessage> messages, bool validateRecursively)

Parameters

messages IList<PropertyValidationMessage>

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

validateRecursively Boolean

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

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.