Table of Contents

Class FileFactory

Namespace
DuetControlServer.Files
Assembly
DuetControlServer.dll

Factory for creating code and macro files

public class FileFactory
Inheritance
FileFactory
Inherited Members

Constructors

FileFactory(ILogger<FileFactory>, IServiceProvider)

Factory for creating code and macro files

public FileFactory(ILogger<FileFactory> logger, IServiceProvider serviceProvider)

Parameters

logger ILogger<FileFactory>

Logger instance

serviceProvider IServiceProvider

Service provider

Methods

Create(CodeFile, CodeChannel)

Create a code file copy for execution on the given channel

public CodeFile Create(CodeFile copyFrom, CodeChannel channel)

Parameters

copyFrom CodeFile
channel CodeChannel

Code channel

Returns

CodeFile

Code file instance

Create(string, string, CodeChannel)

Create a code file for execution on the given channel

public CodeFile Create(string virtualFile, string physicalFile, CodeChannel channel)

Parameters

virtualFile string

Virtual file path

physicalFile string

Physical file path

channel CodeChannel

Code channel

Returns

CodeFile

Code file instance

CreateMacro(MacroFile, CodeChannel)

Create a macro file for execution on the given channel from an existing macro file

public MacroFile CreateMacro(MacroFile copyFrom, CodeChannel channel)

Parameters

copyFrom MacroFile

Macro file to copy from

channel CodeChannel

Code channel requesting the macro

Returns

MacroFile

Macro file or null if it could not be opened

CreateMacro(string, string, CodeChannel, Code?, int)

Create a macro file for execution on the given channel

public MacroFile? CreateMacro(string virtualFile, string physicalFile, CodeChannel channel, Code? startCode = null, int sourceConnection = 0)

Parameters

virtualFile string

Virtual file path

physicalFile string

Physical file path

channel CodeChannel

Code requesting the macro

startCode Code

Code starting the macro file

sourceConnection int

Original IPC connection requesting this macro file

Returns

MacroFile

Macro file or null if it could not be opened