Skip to content

TextFile Constructors ​

Overloads ​

NameDescription
TextFile(FileInfo)Initialises a new instance of the TextFile class from a file on disk.
TextFile(String, Stream)Initialises a new instance of the TextFile class from a Stream containing the file.
TextFile(String, String)Initialises a new instance of the BinaryFile class from a string containing the file.

TextFile(FileInfo) ​

Initialises a new instance of the TextFile class from a file on disk.

c#
public TextFile(FileInfo file);

View source

Parameters ​

NameTypeDescription
fileFileInfoA FileInfo with details a file on disk to load. The FullName will be used for Name.

TextFile(String, Stream) ​

Initialises a new instance of the TextFile class from a Stream containing the file.

c#
public TextFile(string name, Stream text);

View source

Parameters ​

NameTypeDescription
nameStringThe name of the file.
textStreamA Stream containing the file. The stream will be read to the end and left open.

TextFile(String, String) ​

Initialises a new instance of the BinaryFile class from a string containing the file.

c#
public TextFile(string name, string text);

View source

Parameters ​

NameTypeDescription
nameStringThe name of the file.
textStringThe contents of the file.