Click or drag to resize

IFileContent Interface

SOWI Data Interface for File Content. Can usage e.g. for method Import or Export.

Namespace:  SOWIData.Helper.Interface
Assembly:  SOWIData.Helper (in SOWIData.Helper.dll) Version: 19.1.23.1 (19.1.23.622)
Syntax
public interface IFileContent

The IFileContent type exposes the following members.

Properties
  NameDescription
Public propertyContent
File content
Public propertyName
File name
Public propertyType
File type e.g. MIME content type
Top
Remarks
Notes on performance: When all data records (list) are loaded (included field Content), speed problems may occur. Because it loads the contents of the file.
Examples
A simple data class of file content
/// <summary>
/// SOWI Data file handling class
/// </summary>
/// <seealso cref="SOWIData.Helper.Interface.IFileContent"/>
public class SOWIDataFileContent : SOWIData.Helper.Interface.IFileContent
{
    #region --- constructors ---

    /// <summary>
    /// Constructor without parameter
    /// </summary>
    public SOWIDataFileContent() { }

    /// <summary>
    /// Constructor with file parameter
    /// </summary>
    /// <param name="pFilename">file name</param>
    /// <param name="pContent">file content</param>
    /// <param name="pType">e.g. MIME content type</param>
    public SOWIDataFileContent(string pFilename, byte[] pContent, string pType = "") : base()
    {
        this.Name = System.IO.Path.GetFileName(pFilename);
        this.Content = pContent;
        this.Type = pType;
    }

    #endregion

    #region --- fields ---

    /// <summary>
    /// File name
    /// </summary>
    public string Name { get; set; }

    /// <summary>
    /// File conent
    /// </summary>
    public byte[] Content { get; set; }

    /// <summary>
    /// File type
    /// </summary>
    public string Type { get; set; }

    #endregion
}
See Also