Class WindowsFileReference
Windows Universal Platform implementation of the IFileReference interface.
Implements
Inherited Members
Namespace: Dicom.IO
Assembly: cs.temp.dll.dll
Syntax
public sealed class WindowsFileReference : IFileReference
Constructors
WindowsFileReference(String)
Initializes a WindowsFileReference object.
Declaration
public WindowsFileReference(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 |
Open()
Open an existing file stream for reading and writing.
Declaration
public Stream Open()
Returns
Type | Description |
---|---|
Stream | Read/write stream to the opened file. |
OpenRead()
Open a file stream for reading.
Declaration
public Stream OpenRead()
Returns
Type | Description |
---|---|
Stream | Readable 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 | Writeable 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. |