Search Results for

    Show / Hide Table of Contents

    Class File

    Provides a general-purpose binary storage for a large object.

    Inheritance
    object
    DomainObjectBase
    File
    Implements
    IValidator
    IExtensibleDataObject
    IEquatable<File>
    Inherited Members
    DomainObjectBase.ToString()
    DomainObjectBase.Id
    DomainObjectBase.Key
    DomainObjectBase.Created
    DomainObjectBase.Updated
    DomainObjectBase.IsMajorObject
    DomainObjectBase.ErrorMessage
    DomainObjectBase.ExtensionData
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Nevatech.Vsb.Repository.Entities
    Assembly: Nevatech.Vsb.Repository.dll
    Syntax
    [DataContract(Namespace = "http://schemas.nevatech.com/sentinet/2011/02")]
    public sealed class File : DomainObjectBase, IValidator, IExtensibleDataObject, IEquatable<File>

    Constructors

    File()

    Initializes an empty instance.

    Declaration
    public File()

    File(byte[], FileType)

    Creates new temporary file from provided bytes.

    Declaration
    public File(byte[] content, FileType contentType)
    Parameters
    Type Name Description
    byte[] content

    Bytes to be written to the file.

    FileType contentType

    File content type.

    File(MetadataSet)

    Creates new temporary file from provided service metadata.

    Declaration
    public File(MetadataSet metadata)
    Parameters
    Type Name Description
    MetadataSet metadata

    Metadata to be initialized from.

    File(string, FileType)

    Creates new temporary file from provided text string.

    Declaration
    public File(string content, FileType contentType)
    Parameters
    Type Name Description
    string content

    Text to be written to the file.

    FileType contentType

    File content type.

    Fields

    DefaultExpiration

    Default expiration time period for a temporary file.

    Declaration
    public static readonly TimeSpan DefaultExpiration
    Field Value
    Type Description
    TimeSpan

    Properties

    Content

    Gets or sets the binary content of the file.

    Declaration
    [DataMember(EmitDefaultValue = false)]
    [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
    public byte[] Content { get; set; }
    Property Value
    Type Description
    byte[]

    ContentType

    Gets or sets the type of the stored content.

    Declaration
    [DataMember]
    public FileType ContentType { get; set; }
    Property Value
    Type Description
    FileType

    Expired

    Gets or sets the date and time when file expires and can be deleted. If Null, then file never expires.

    Declaration
    [DataMember(EmitDefaultValue = false)]
    public DateTime? Expired { get; set; }
    Property Value
    Type Description
    DateTime?

    FileName

    Gets or sets the original file name on disk.

    Declaration
    [DataMember(EmitDefaultValue = false)]
    public string FileName { get; set; }
    Property Value
    Type Description
    string

    LastUpdated

    Gets the date and time when file was updated or created.

    Declaration
    public DateTime LastUpdated { get; }
    Property Value
    Type Description
    DateTime

    ObjectType

    Gets object type identifier.

    Declaration
    public override EntityType ObjectType { get; }
    Property Value
    Type Description
    EntityType
    Overrides
    DomainObjectBase.ObjectType

    Methods

    Equals(File)

    Determines whether the specified object is equal to the current object.

    Declaration
    public bool Equals(File other)
    Parameters
    Type Name Description
    File other

    The object to compare with the current object.

    Returns
    Type Description
    bool

    True, if objects are equal. False, if objects are not equal.

    Equals(object)

    Determines whether the specified object is equal to the current object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare with the current object.

    Returns
    Type Description
    bool

    True, if objects are equal. False, if objects are not equal.

    Overrides
    DomainObjectBase.Equals(object)

    GetContentAsMetadata()

    Retrieves metadata stored in the file.

    Declaration
    [SuppressMessage("Microsoft.Usage", "CA2202:Do not dispose objects multiple times")]
    [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
    public MetadataSet GetContentAsMetadata()
    Returns
    Type Description
    MetadataSet

    Metadata stored in the file or Null, if content is empty.

    GetContentAsText()

    Retrieves text string stored in the file content.

    Declaration
    [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")]
    public string GetContentAsText()
    Returns
    Type Description
    string

    Text string stored in the file content or Null, if content is empty.

    GetHashCode()

    Returns the hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    Hash code of the current instance.

    Overrides
    DomainObjectBase.GetHashCode()

    Validate()

    Evaluates the state of this object.

    Declaration
    public override bool Validate()
    Returns
    Type Description
    bool

    True if state is valid; otherwise, false.

    Overrides
    DomainObjectBase.Validate()

    Implements

    IValidator
    IExtensibleDataObject
    IEquatable<T>
    In This Article
    Back to top Nevatech Sentinet 6.7 Online Documentation