Class ReadFile
Reads a file from disk to a stream.
public sealed class ReadFile : TaskBase, ITask
- Inheritance
-
objectMarshalByRefObjectReadFile
- Implements
- Inherited Members
- Extension Methods
Constructors
ReadFile(string, Action<Stream>, string?)
Reads a file from disk to a stream.
public ReadFile(string path, Action<Stream> callback, string? name = null)
Parameters
path
stringThe path of the file to read.
callback
Action<Stream>Called with a stream providing the file content.
name
stringA name describing the task in human-readable form.
Properties
Name
A name describing the task in human-readable form.
public override string Name { get; }
Property Value
- string
UnitsByte
true
if UnitsProcessed and UnitsTotal are measured in bytes;
false
if they are measured in generic units.
protected override bool UnitsByte { get; }
Property Value
- bool
Methods
Execute()
The actual code to be executed.
protected override void Execute()
Remarks
State is automatically set to Started before calling this method, to Complete after a successful exit and to an appropriate error state in case on an exception. You can set additional TaskStates during execution.