Show / Hide Table of Contents

Class TempFile

Provides file backing for an embedded resource. It is up to the caller to dispose any TempFile instances to ensure clean-up of files created.

Inheritance
Object
TempFile
Implements
IDisposable
Inherited Members
Object.Equals(Object)
Object.Equals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()
Object.ReferenceEquals(Object, Object)
Object.ToString()
Namespace: Firefly.EmbeddedResourceLoader.Materialization
Assembly: Firefly.EmbeddedResourceLoader.dll
Syntax
public class TempFile : IDisposable

Constructors

| Improve this Doc View Source

TempFile(Stream, String)

Initializes a new instance of the TempFile class.

Declaration
public TempFile(Stream resourceData, string fileExtension = ".tmp")
Parameters
Type Name Description
Stream resourceData

The resource data to copy to the file.

String fileExtension

File extension to use for the temp file.

| Improve this Doc View Source

TempFile(String)

Initializes a new instance of the TempFile class. It is not created until written to

Declaration
public TempFile(string fileExtension = ".tmp")
Parameters
Type Name Description
String fileExtension

File extension to use for the temp file.

| Improve this Doc View Source

TempFile(String, String)

Initializes a new instance of the TempFile class.

Declaration
public TempFile(string content, string fileExtension = ".tmp")
Parameters
Type Name Description
String content

String content to copy to the file.

String fileExtension

File extension to use for the temp file.

Properties

| Improve this Doc View Source

FullPath

Gets the full path to the temporary file.

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

The full path to the temporary file

Methods

| Improve this Doc View Source

Dispose()

Removes the temporary file.

Declaration
public void Dispose()
| Improve this Doc View Source

Write(Stream)

Writes data from stream to the temp file.

Declaration
public void Write(Stream streamData)
Parameters
Type Name Description
Stream streamData

Stream to write to the file.

| Improve this Doc View Source

Write(String)

Writes data from string to the temp file.

Declaration
public void Write(string stringData)
Parameters
Type Name Description
String stringData

String to write to the file.

Operators

| Improve this Doc View Source

Implicit(TempFile to String)

Performs an implicit conversion from TempFile to String.

Declaration
public static implicit operator string (TempFile self)
Parameters
Type Name Description
TempFile self

The TempFile object.

Returns
Type Description
String

The fill path to the temp file.

Implements

System.IDisposable

See Also

IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX