Search Results for

    Show / Hide Table of Contents

    Class DesktopFileReference

    .NET/Windows Desktop implementation of the IFileReference interface.

    Inheritance
    Object
    DesktopFileReference
    Implements
    IFileReference
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Dicom.IO
    Assembly: cs.temp.dll.dll
    Syntax
    public sealed class DesktopFileReference : IFileReference

    Constructors

    DesktopFileReference(String)

    Initializes a DesktopFileReference object.

    Declaration
    public DesktopFileReference(string fileName)
    Parameters
    Type Name Description
    String fileName

    File name.

    Properties

    Directory

    Gets the directory reference of the file.

    Declaration
    public IDirectoryReference Directory { get; }
    Property Value
    Type Description
    IDirectoryReference

    Exists

    Gets whether the file exist or not.

    Declaration
    public bool Exists { get; }
    Property Value
    Type Description
    Boolean

    IsTempFile

    Gets and sets whether the file is temporary or not.

    Declaration
    public bool IsTempFile { get; set; }
    Property Value
    Type Description
    Boolean
    Remarks

    Temporary file will be deleted when object is Disposed.

    Name

    Gets the file name.

    Declaration
    public string Name { get; }
    Property Value
    Type Description
    String

    Methods

    Create()

    Creates a new file for reading and writing. Overwrites existing file.

    Declaration
    public Stream Create()
    Returns
    Type Description
    Stream

    Stream to the created file.

    Delete()

    Delete the file.

    Declaration
    public void Delete()

    Finalize()

    Destructor.

    Declaration
    protected void Finalize()

    GetByteRange(Int64, Int32)

    Gets a sub-range of the bytes in the file.

    Declaration
    public byte[] GetByteRange(long offset, int count)
    Parameters
    Type Name Description
    Int64 offset

    Offset from the start position of the file.

    Int32 count

    Number of bytes to select.

    Returns
    Type Description
    Byte[]

    The specified sub-range of bytes in the file.

    Move(String, Boolean)

    Moves file and updates internal reference.

    Calling this method will also remove set the IsTempFile property to False.

    Declaration
    public void Move(string dstFileName, bool overwrite = false)
    Parameters
    Type Name Description
    String dstFileName

    Name of the destination file.

    Boolean overwrite

    True if dstFileName should be overwritten if it already exists, false otherwise.

    Open()

    Open an existing file stream for reading and writing.

    Declaration
    public Stream Open()
    Returns
    Type Description
    Stream

    OpenRead()

    Open a file stream for reading.

    Declaration
    public Stream OpenRead()
    Returns
    Type Description
    Stream

    Stream to the opened file.

    OpenWrite()

    Open a file stream for writing, creates the file if not existing.

    Declaration
    public Stream OpenWrite()
    Returns
    Type Description
    Stream

    Stream to the opened file.

    ToString()

    Returns a string that represents the current object.

    Declaration
    public override string ToString()
    Returns
    Type Description
    String

    A string that represents the current object.

    Overrides
    Object.ToString()

    Implements

    IFileReference
    In This Article
    Back to top Copyright (c) 2012-2021 fo-dicom contributors