File Class

Definition

Represents information about a file.

public class File : Microsoft.Health.HealthRecordItem
Inheritance

Inherited Members

Microsoft.Health.HealthRecordItem

Constructors

File()

Creates a new instance of the File class with default values.

File(String, Int64)

Creates a new instance of the File class with the specified name and size.

Fields

TypeId

Retrieves the unique identifier for the item type.

Properties

Content

Gets the content of the file item.

ContentStream

Gets a stream to read the file contents.

ContentType

Gets or sets the type of content contained in the file.

Name

Gets or sets the name of the file including the extension if available.

Size

Gets or sets the file size.

Methods

CreateFromFilePath(String, CodableValue)

Creates a File item instance using the specified file path and content type.

CreateFromStream(HealthRecordAccessor, Stream, String, CodableValue)

Creates a File item instance using the specified stream and content type.

ParseXml(IXPathNavigable)

Populates this File instance from the data in the XML.

SetContent(String, CodableValue)

Sets the content of the file instance using the specified file.

SetContent(HealthRecordAccessor, Stream, String, CodableValue)

Sets the content of the file instance using the specified stream.

ToString()

Gets a string representation of the file item.

WriteXml(XmlWriter)

Writes the file data to the specified XmlWriter.